This repository was archived by the owner on Jan 13, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Expand file tree Collapse file tree 1 file changed +27
-0
lines changed Original file line number Diff line number Diff line change @@ -221,6 +221,33 @@ def test_putrequest_sends_data(self):
221
221
assert len (sock .queue ) == 2
222
222
assert c ._out_flow_control_window == 65535 - len (b'hello' )
223
223
224
+ def test_different_request_headers (self ):
225
+ sock = DummySocket ()
226
+
227
+ c = HTTP20Connection ('www.google.com' )
228
+ c ._sock = sock
229
+ c .request ('GET' , '/' , body = 'hello' , headers = {b'name' : b'value' })
230
+ s = c .recent_stream
231
+
232
+ assert list (s .headers .items ()) == [
233
+ (b':method' , b'GET' ),
234
+ (b':scheme' , b'https' ),
235
+ (b':authority' , b'www.google.com' ),
236
+ (b':path' , b'/' ),
237
+ (b'name' , b'value' ),
238
+ ]
239
+
240
+ c .request ('GET' , '/' , body = 'hello' , headers = {u'name2' : u'value2' })
241
+ s = c .recent_stream
242
+
243
+ assert list (s .headers .items ()) == [
244
+ (b':method' , b'GET' ),
245
+ (b':scheme' , b'https' ),
246
+ (b':authority' , b'www.google.com' ),
247
+ (b':path' , b'/' ),
248
+ (b'name2' , b'value2' ),
249
+ ]
250
+
224
251
def test_closed_connections_are_reset (self ):
225
252
c = HTTP20Connection ('www.google.com' )
226
253
c ._sock = DummySocket ()
You can’t perform that action at this time.
0 commit comments