Skip to content

Commit bf5d1a0

Browse files
committed
Remove methods from middleware.
1 parent 09707df commit bf5d1a0

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

lib/protocol/http/middleware.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ module HTTP
2020
# The call method is called for each request. The close method is called when the server is shutting down.
2121
#
2222
# You do not need to use the Middleware class to implement middleware. You can implement the interface directly.
23-
class Middleware < Methods
23+
class Middleware
2424
# Convert a block to a middleware delegate.
2525
def self.for(&block)
2626
def block.close

test/protocol/http/content_encoding.rb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
let(:accept_encoding) {Protocol::HTTP::AcceptEncoding.new(middleware)}
1313

1414
it "can request resource without compression" do
15-
response = middleware.get("/index")
15+
response = middleware.call(Protocol::HTTP::Request["GET", "/index"])
1616

1717
expect(response).to be(:success?)
1818
expect(response.headers).not.to have_keys('content-encoding')
@@ -22,7 +22,7 @@
2222
end
2323

2424
it "can request a resource with the identity encoding" do
25-
response = accept_encoding.get("/index", {'accept-encoding' => 'identity'})
25+
response = accept_encoding.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'identity'}])
2626

2727
expect(response).to be(:success?)
2828
expect(response.headers).not.to have_keys('content-encoding')
@@ -32,7 +32,7 @@
3232
end
3333

3434
it "can request resource with compression" do
35-
response = accept_encoding.get("/index", {'accept-encoding' => 'gzip'})
35+
response = accept_encoding.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'gzip'}])
3636
expect(response).to be(:success?)
3737

3838
expect(response.headers['vary']).to be(:include?, 'accept-encoding')
@@ -52,7 +52,7 @@
5252
let(:client) {subject.new(app)}
5353

5454
it "can request resource with compression" do
55-
response = client.get("/index", {'accept-encoding' => 'gzip'})
55+
response = client.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'gzip'}])
5656
expect(response).to be(:success?)
5757

5858
expect(response.headers).not.to have_keys('content-encoding')
@@ -70,7 +70,7 @@
7070
let(:client) {subject.new(app)}
7171

7272
it "does not compress response" do
73-
response = client.get("/index", {'accept-encoding' => 'gzip'})
73+
response = client.call(Protocol::HTTP::Request["GET", "/index", {'accept-encoding' => 'gzip'}])
7474

7575
expect(response).to be(:success?)
7676
expect(response.headers).to have_keys('content-encoding')

0 commit comments

Comments
 (0)