Skip to content

Commit eb5fa4c

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

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
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 & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33
# Released under the MIT License.
44
# Copyright, 2024, by Samuel Williams.
55

6-
require_relative "../reference"
7-
86
require "protocol/http/middleware"
97
require "protocol/http/body/rewindable"
8+
require "protocol/url/reference"
109

1110
module Async
1211
module HTTP
@@ -71,7 +70,7 @@ def handle_redirect(request, location)
7170
end
7271

7372
# Update the path of the request:
74-
request.path = Reference[request.path] + location
73+
request.path = Protocol::URL::Reference[request.path] + location
7574

7675
# Follow the redirect:
7776
return true

lib/async/http/reference.rb

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

0 commit comments

Comments
 (0)