@@ -50,55 +50,13 @@ describe('resty.http.proxy', function()
50
50
it (' connects to the #http_proxy' , function ()
51
51
_M :reset ({ http_proxy = ' http://127.0.0.1:1984' })
52
52
53
- local request = { url = ' http://127.0.0.1:1984 /request' , method = ' GET' }
53
+ local request = { url = ' http://upstream:8091 /request' , method = ' GET' }
54
54
local proxy = assert (_M .new (request ))
55
55
56
56
local res = assert (proxy :request (request ))
57
57
58
58
assert .same (200 , res .status )
59
- assert .match (' GET http://127.0.0.1:1984/request HTTP/1.1' , res :read_body ())
60
- end )
61
-
62
- -- Regression test. Ref: https://issues.jboss.org/browse/THREESCALE-2205
63
- context (' when different subdomains resolve to the same IP' , function ()
64
- local request_domain_1 = { url = ' http://test.example.com/' , method = ' GET' }
65
- local request_domain_2 = { url = ' http://prod.example.com/' , method = ' GET' }
66
-
67
- before_each (function ()
68
- -- Make everything resolve to the same IP
69
- local resty_resolver = require ' resty.resolver.http'
70
- stub (resty_resolver , ' resolve' , function () return " 1.1.1.1" , 80 end )
71
- end )
72
-
73
- context (' and it uses a http proxy' , function ()
74
- before_each (function ()
75
- _M :reset ({ http_proxy = ' http://127.0.0.1:1984' })
76
- end )
77
-
78
- it (' does not reuse the connection' , function ()
79
- local proxy = _M .new (request_domain_1 )
80
- proxy :request (request_domain_1 ):read_body ()
81
- proxy :set_keepalive ()
82
-
83
- proxy = _M .new (request_domain_2 )
84
- assert .same (0 , proxy :get_reused_times ())
85
- end )
86
- end )
87
-
88
- context (' and it does not use an http proxy' , function ()
89
- before_each (function ()
90
- _M :reset ({})
91
- end )
92
-
93
- it (' does not reuse the connection' , function ()
94
- local proxy = _M .new (request_domain_1 )
95
- proxy :request (request_domain_1 ):read_body ()
96
- proxy :set_keepalive ()
97
-
98
- proxy = _M .new (request_domain_2 )
99
- assert .same (0 , proxy :get_reused_times ())
100
- end )
101
- end )
59
+ assert .match (' GET http://upstream:8091/request HTTP/1.1' , res :read_body ())
102
60
end )
103
61
end )
104
62
end )
0 commit comments