Skip to content

Commit 657d0c8

Browse files
committed
Use Protocol::URL::Reference directly.
1 parent 486074a commit 657d0c8

File tree

3 files changed

+3
-13
lines changed

3 files changed

+3
-13
lines changed

async-http.gemspec

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,6 @@ Gem::Specification.new do |spec|
3232
spec.add_dependency "protocol-http", "~> 0.49"
3333
spec.add_dependency "protocol-http1", "~> 0.30"
3434
spec.add_dependency "protocol-http2", "~> 0.22"
35+
spec.add_dependency "protocol-url", "~> 0.2"
3536
spec.add_dependency "traces", "~> 0.10"
3637
end

lib/async/http/middleware/location_redirector.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
require "protocol/http/middleware"
99
require "protocol/http/body/rewindable"
10+
require "protocol/url/reference"
1011

1112
module Async
1213
module HTTP
@@ -71,7 +72,7 @@ def handle_redirect(request, location)
7172
end
7273

7374
# Update the path of the request:
74-
request.path = Reference[request.path] + location
75+
request.path = Protocol::URL::Reference[request.path] + location
7576

7677
# Follow the redirect:
7778
return true

lib/async/http/reference.rb

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)