@@ -30,8 +30,9 @@ describe("http1 stream", function()
30
30
local stream = client :new_stream ()
31
31
client :shutdown ()
32
32
local headers = new_headers ()
33
- headers :append (" :authority" , " myauthority" )
34
33
headers :append (" :method" , " GET" )
34
+ headers :append (" :scheme" , " http" )
35
+ headers :append (" :authority" , " myauthority" )
35
36
headers :append (" :path" , " /a" )
36
37
assert .same (ce .EPIPE , select (3 , stream :write_headers (headers , true )))
37
38
client :close ()
@@ -43,8 +44,9 @@ describe("http1 stream", function()
43
44
cq :wrap (function ()
44
45
local stream = client :new_stream ()
45
46
local req_headers = new_headers ()
46
- req_headers :append (" :authority" , " myauthority" )
47
47
req_headers :append (" :method" , " GET" )
48
+ req_headers :append (" :scheme" , " http" )
49
+ req_headers :append (" :authority" , " myauthority" )
48
50
req_headers :append (" :path" , " /a" )
49
51
assert (stream :write_headers (req_headers , true ))
50
52
local res_headers = assert (stream :get_headers ())
@@ -91,8 +93,9 @@ describe("http1 stream", function()
91
93
local server , client = new_pair (1.1 )
92
94
local stream = client :new_stream ()
93
95
local headers = new_headers ()
94
- headers :append (" :authority" , " myauthority" )
95
96
headers :append (" :method" , " GET" )
97
+ headers :append (" :scheme" , " http" )
98
+ headers :append (" :authority" , " myauthority" )
96
99
headers :append (" :path" , " /a" )
97
100
assert (stream :write_headers (headers , true ))
98
101
local cq = cqueues .new ():wrap (function ()
@@ -109,8 +112,9 @@ describe("http1 stream", function()
109
112
cq :wrap (function ()
110
113
local stream = client :new_stream ()
111
114
local req_headers = new_headers ()
112
- req_headers :append (" :authority" , " myauthority" )
113
115
req_headers :append (" :method" , " GET" )
116
+ req_headers :append (" :scheme" , " http" )
117
+ req_headers :append (" :authority" , " myauthority" )
114
118
req_headers :append (" :path" , " /a" )
115
119
assert (stream :write_headers (req_headers , true ))
116
120
local res_headers = assert (stream :get_headers ())
@@ -135,8 +139,9 @@ describe("http1 stream", function()
135
139
cq :wrap (function ()
136
140
local stream = client :new_stream ()
137
141
local req_headers = new_headers ()
138
- req_headers :append (" :authority" , " myauthority" )
139
142
req_headers :append (" :method" , " GET" )
143
+ req_headers :append (" :scheme" , " http" )
144
+ req_headers :append (" :authority" , " myauthority" )
140
145
req_headers :append (" :path" , " /a" )
141
146
assert (stream :write_headers (req_headers , true ))
142
147
assert (stream :get_headers ())
@@ -166,8 +171,9 @@ describe("http1 stream", function()
166
171
cq :wrap (function ()
167
172
local stream = client :new_stream ()
168
173
local headers = new_headers ()
169
- headers :append (" :authority" , " myauthority" )
170
174
headers :append (" :method" , " GET" )
175
+ headers :append (" :scheme" , " http" )
176
+ headers :append (" :authority" , " myauthority" )
171
177
headers :append (" :path" , " /a" )
172
178
headers :append (" transfer-encoding" , " chunked" )
173
179
assert (stream :write_headers (headers , false ))
@@ -217,8 +223,9 @@ describe("http1 stream", function()
217
223
cq :wrap (function ()
218
224
local stream = client :new_stream ()
219
225
local headers = new_headers ()
220
- headers :append (" :authority" , " myauthority" )
221
226
headers :append (" :method" , " GET" )
227
+ headers :append (" :scheme" , " http" )
228
+ headers :append (" :authority" , " myauthority" )
222
229
headers :append (" :path" , " /a" )
223
230
headers :append (" transfer-encoding" , " chunked" )
224
231
assert (stream :write_headers (headers , false ))
@@ -248,8 +255,9 @@ describe("http1 stream", function()
248
255
do
249
256
local stream = client :new_stream ()
250
257
local headers = new_headers ()
251
- headers :append (" :authority" , " myauthority" )
252
258
headers :append (" :method" , " GET" )
259
+ headers :append (" :scheme" , " http" )
260
+ headers :append (" :authority" , " myauthority" )
253
261
headers :append (" :path" , " /a" )
254
262
headers :append (" content-length" , " 100" )
255
263
assert (stream :write_headers (headers , false ))
@@ -258,8 +266,9 @@ describe("http1 stream", function()
258
266
do
259
267
local stream = client :new_stream ()
260
268
local headers = new_headers ()
261
- headers :append (" :authority" , " myauthority" )
262
269
headers :append (" :method" , " GET" )
270
+ headers :append (" :scheme" , " http" )
271
+ headers :append (" :authority" , " myauthority" )
263
272
headers :append (" :path" , " /b" )
264
273
headers :append (" content-length" , " 0" )
265
274
assert (stream :write_headers (headers , true ))
@@ -313,17 +322,19 @@ describe("http1 stream", function()
313
322
if client_sync then client_sync :wait () end
314
323
local a = client :new_stream ()
315
324
local ah = new_headers ()
316
- ah :append (" :authority" , " myauthority" )
317
325
ah :append (" :method" , " GET" )
326
+ ah :append (" :scheme" , " http" )
327
+ ah :append (" :authority" , " myauthority" )
318
328
ah :append (" :path" , " /a" )
319
329
assert (a :write_headers (ah , true ))
320
330
end )
321
331
cq :wrap (function ()
322
332
client_sync :signal (); client_sync = nil ;
323
333
local b = client :new_stream ()
324
334
local bh = new_headers ()
325
- bh :append (" :authority" , " myauthority" )
326
335
bh :append (" :method" , " POST" )
336
+ bh :append (" :scheme" , " http" )
337
+ bh :append (" :authority" , " myauthority" )
327
338
bh :append (" :path" , " /b" )
328
339
assert (b :write_headers (bh , false ))
329
340
cqueues .sleep (0.01 )
@@ -332,8 +343,9 @@ describe("http1 stream", function()
332
343
cq :wrap (function ()
333
344
local c = client :new_stream ()
334
345
local ch = new_headers ()
335
- ch :append (" :authority" , " myauthority" )
336
346
ch :append (" :method" , " GET" )
347
+ ch :append (" :scheme" , " http" )
348
+ ch :append (" :authority" , " myauthority" )
337
349
ch :append (" :path" , " /c" )
338
350
assert (c :write_headers (ch , true ))
339
351
end )
@@ -375,8 +387,9 @@ describe("http1 stream", function()
375
387
376
388
do
377
389
local h = new_headers ()
378
- h :append (" :authority" , " myauthority" )
379
390
h :append (" :method" , " POST" )
391
+ h :append (" :scheme" , " http" )
392
+ h :append (" :authority" , " myauthority" )
380
393
h :append (" :path" , " /" )
381
394
h :upsert (" id" , " a" )
382
395
assert (a :write_headers (h , false ))
@@ -443,8 +456,9 @@ describe("http1 stream", function()
443
456
cq :wrap (function ()
444
457
local a = client :new_stream ()
445
458
local h = new_headers ()
446
- h :append (" :authority" , " myauthority" )
447
459
h :append (" :method" , " POST" )
460
+ h :append (" :scheme" , " http" )
461
+ h :append (" :authority" , " myauthority" )
448
462
h :append (" :path" , " /a" )
449
463
h :append (" expect" , " 100-continue" )
450
464
assert (a :write_headers (h , false ))
@@ -476,8 +490,9 @@ describe("http1 stream", function()
476
490
cq :wrap (function ()
477
491
local a = client :new_stream ()
478
492
local h = new_headers ()
479
- h :append (" :authority" , " myauthority" )
480
493
h :append (" :method" , " GET" )
494
+ h :append (" :scheme" , " http" )
495
+ h :append (" :authority" , " myauthority" )
481
496
h :append (" :path" , " /" )
482
497
assert (a :write_headers (h , true ))
483
498
end )
0 commit comments