@@ -142,21 +142,30 @@ def test_redirect_cross_host_remove_headers(self):
142
142
"GET" ,
143
143
"%s/redirect" % self .base_url ,
144
144
fields = {"target" : "%s/headers" % self .base_url_alt },
145
- headers = {"Authorization" : "foo" , "Cookie" : "foo=bar" },
145
+ headers = {
146
+ "Authorization" : "foo" ,
147
+ "Proxy-Authorization" : "bar" ,
148
+ "Cookie" : "foo=bar" ,
149
+ },
146
150
)
147
151
148
152
assert r .status == 200
149
153
150
154
data = json .loads (r .data .decode ("utf-8" ))
151
155
152
156
assert "Authorization" not in data
157
+ assert "Proxy-Authorization" not in data
153
158
assert "Cookie" not in data
154
159
155
160
r = http .request (
156
161
"GET" ,
157
162
"%s/redirect" % self .base_url ,
158
163
fields = {"target" : "%s/headers" % self .base_url_alt },
159
- headers = {"authorization" : "foo" , "cookie" : "foo=bar" },
164
+ headers = {
165
+ "authorization" : "foo" ,
166
+ "proxy-authorization" : "baz" ,
167
+ "cookie" : "foo=bar" ,
168
+ },
160
169
)
161
170
162
171
assert r .status == 200
@@ -165,6 +174,8 @@ def test_redirect_cross_host_remove_headers(self):
165
174
166
175
assert "authorization" not in data
167
176
assert "Authorization" not in data
177
+ assert "proxy-authorization" not in data
178
+ assert "Proxy-Authorization" not in data
168
179
assert "cookie" not in data
169
180
assert "Cookie" not in data
170
181
@@ -174,7 +185,11 @@ def test_redirect_cross_host_no_remove_headers(self):
174
185
"GET" ,
175
186
"%s/redirect" % self .base_url ,
176
187
fields = {"target" : "%s/headers" % self .base_url_alt },
177
- headers = {"Authorization" : "foo" , "Cookie" : "foo=bar" },
188
+ headers = {
189
+ "Authorization" : "foo" ,
190
+ "Proxy-Authorization" : "bar" ,
191
+ "Cookie" : "foo=bar" ,
192
+ },
178
193
retries = Retry (remove_headers_on_redirect = []),
179
194
)
180
195
@@ -183,6 +198,7 @@ def test_redirect_cross_host_no_remove_headers(self):
183
198
data = json .loads (r .data .decode ("utf-8" ))
184
199
185
200
assert data ["Authorization" ] == "foo"
201
+ assert data ["Proxy-Authorization" ] == "bar"
186
202
assert data ["Cookie" ] == "foo=bar"
187
203
188
204
def test_redirect_cross_host_set_removed_headers (self ):
@@ -194,6 +210,7 @@ def test_redirect_cross_host_set_removed_headers(self):
194
210
headers = {
195
211
"X-API-Secret" : "foo" ,
196
212
"Authorization" : "bar" ,
213
+ "Proxy-Authorization" : "baz" ,
197
214
"Cookie" : "foo=bar" ,
198
215
},
199
216
retries = Retry (remove_headers_on_redirect = ["X-API-Secret" ]),
@@ -205,6 +222,7 @@ def test_redirect_cross_host_set_removed_headers(self):
205
222
206
223
assert "X-API-Secret" not in data
207
224
assert data ["Authorization" ] == "bar"
225
+ assert data ["Proxy-Authorization" ] == "baz"
208
226
assert data ["Cookie" ] == "foo=bar"
209
227
210
228
r = http .request (
@@ -213,6 +231,7 @@ def test_redirect_cross_host_set_removed_headers(self):
213
231
fields = {"target" : "%s/headers" % self .base_url_alt },
214
232
headers = {
215
233
"x-api-secret" : "foo" ,
234
+ "proxy-authorization" : "baz" ,
216
235
"authorization" : "bar" ,
217
236
"cookie" : "foo=bar" ,
218
237
},
@@ -226,6 +245,7 @@ def test_redirect_cross_host_set_removed_headers(self):
226
245
assert "x-api-secret" not in data
227
246
assert "X-API-Secret" not in data
228
247
assert data ["Authorization" ] == "bar"
248
+ assert data ["Proxy-Authorization" ] == "baz"
229
249
assert data ["Cookie" ] == "foo=bar"
230
250
231
251
def test_redirect_without_preload_releases_connection (self ):
0 commit comments