summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormokha <mokha@cisco.com>2019-02-06 11:02:55 -0700
committermokha <mokha@cisco.com>2019-02-06 11:02:55 -0700
commitc4d70ed77e63c42df7361beefc01314b4a222d0d (patch)
tree5584ed5c011b60517da6197fa621f2f580c1c611
parentf28c0404dfe5d56a770246c3946ce5650ba46e3c (diff)
revert change in 0.2.4
```text The absoluteURI form is REQUIRED when the request is being made to a proxy. The proxy is requested to forward the request or service it from a valid cache, and return the response. Note that the proxy MAY forward the request on to another proxy or directly to the server To allow for transition to absoluteURIs in all requests in future versions of HTTP, all HTTP/1.1 servers MUST accept the absoluteURI form in requests, even though HTTP/1.1 clients will only generate them in requests to proxies. In this case the absolute path of the URI MUST be transmitted (see section 3.2.1, abs_path) as the Request-URI, and the network location of the URI (authority) MUST be transmitted in a Host header field. For example, a client wishing to retrieve the resource above directly from the origin server would create a TCP connection to port 80 of the host "www.w3.org" and send the lines: GET /pub/WWW/TheProject.html HTTP/1.1 Host: www.w3.org ``` https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html
-rw-r--r--CHANGELOG.md2
-rw-r--r--lib/net/hippie/client.rb4
2 files changed, 2 insertions, 4 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index abbd7e6..ea1a583 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -9,7 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## [0.2.5] - 2019-02-06
### Changed
-- default to '/' when a path is not found
+- revert change introduced in 0.2.4. See [5.12][https://www.w3.org/Protocols/rfc2616/rfc2616-sec5.html]
## [0.2.4] - 2019-02-06
### Changed
diff --git a/lib/net/hippie/client.rb b/lib/net/hippie/client.rb
index fb847fc..8983833 100644
--- a/lib/net/hippie/client.rb
+++ b/lib/net/hippie/client.rb
@@ -106,10 +106,8 @@ module Net
end
def request_for(type, uri, headers: {}, body: {})
- uri = URI.parse(uri.to_s)
- path = uri.path == '' ? '/' : uri.path
final_headers = default_headers.merge(headers)
- type.new(path || '/', final_headers).tap do |x|
+ type.new(uri.to_s, final_headers).tap do |x|
x.body = mapper.map_from(final_headers, body) unless body.empty?
end
end