@@ -74,7 +74,22 @@ error status returned by host: not found
74
74
75
75
76
76
77
- === TEST 4 : get header, ignoring case
77
+ === TEST 4 : get http request authority
78
+ -- - config
79
+ location / t {
80
+ content_by_lua_block {
81
+ local wasm = require (" resty.proxy-wasm" )
82
+ local plugin = assert(wasm. load(" plugin" , " t/testdata/http_header/main.go.wasm" ))
83
+ local ctx = assert(wasm. on_configure(plugin, ' req_hdr_get_authority' ))
84
+ assert(wasm. on_http_request_headers(ctx))
85
+ }
86
+ }
87
+ -- - error_log
88
+ get request authority: localhost
89
+
90
+
91
+
92
+ === TEST 5 : get header, ignoring case
78
93
-- - config
79
94
location / t {
80
95
content_by_lua_block {
@@ -93,7 +108,7 @@ get request header: foo,
93
108
94
109
95
110
96
- === TEST 5 : get all header
111
+ === TEST 6 : get all header
97
112
-- - config
98
113
location / t {
99
114
content_by_lua_block {
@@ -114,10 +129,11 @@ get request header: x-api foo
114
129
get request header: : scheme http
115
130
get request header: : path / t
116
131
get request header: : method GET
132
+ get request header: : authority localhost
117
133
118
134
119
135
120
- === TEST 6 : get all header, repeated headers
136
+ === TEST 7 : get all header, repeated headers
121
137
-- - config
122
138
location / t {
123
139
content_by_lua_block {
@@ -140,10 +156,11 @@ get request header: x-api bar
140
156
get request header: : scheme http
141
157
get request header: : path / t
142
158
get request header: : method GET
159
+ get request header: : authority localhost
143
160
144
161
145
162
146
- === TEST 7 : set header
163
+ === TEST 8 : set header
147
164
-- - config
148
165
location / t {
149
166
access_by_lua_block {
163
180
164
181
165
182
166
- === TEST 8 : set header, missing
183
+ === TEST 9 : set header, missing
167
184
-- - config
168
185
location / t {
169
186
access_by_lua_block {
181
198
182
199
183
200
184
- === TEST 9 : add header
201
+ === TEST 10 : add header
185
202
-- - config
186
203
location / t {
187
204
access_by_lua_block {
@@ -201,7 +218,7 @@ foobar
201
218
202
219
203
220
204
- === TEST 10 : add header, missing
221
+ === TEST 11 : add header, missing
205
222
-- - config
206
223
location / t {
207
224
access_by_lua_block {
219
236
220
237
221
238
222
- === TEST 11 : remove header
239
+ === TEST 12 : remove header
223
240
-- - config
224
241
location / t {
225
242
access_by_lua_block {
239
256
240
257
241
258
242
- === TEST 12 : remove header, missing
259
+ === TEST 13 : remove header, missing
243
260
-- - config
244
261
location / t {
245
262
access_by_lua_block {
257
274
258
275
259
276
260
- === TEST 13 : remove header, all of it
277
+ === TEST 14 : remove header, all of it
261
278
-- - config
262
279
location / t {
263
280
access_by_lua_block {
278
295
279
296
280
297
281
- === TEST 14 : get path (not args)
298
+ === TEST 15 : get path (not args)
282
299
-- - config
283
300
location / t {
284
301
content_by_lua_block {
@@ -295,7 +312,7 @@ get request path: /t,
295
312
296
313
297
314
298
- === TEST 15 : get path (args)
315
+ === TEST 16 : get path (args)
299
316
-- - config
300
317
location / t {
301
318
content_by_lua_block {
@@ -314,7 +331,7 @@ get request path: /t?q=hello&a=world,
314
331
315
332
316
333
317
- === TEST 16 : get method (GET)
334
+ === TEST 17 : get method (GET)
318
335
-- - config
319
336
location / t {
320
337
content_by_lua_block {
@@ -331,7 +348,7 @@ get request method: GET,
331
348
332
349
333
350
334
- === TEST 17 : get method (POST )
351
+ === TEST 18 : get method (POST )
335
352
-- - config
336
353
location / t {
337
354
content_by_lua_block {
@@ -350,7 +367,7 @@ get request method: POST,
350
367
351
368
352
369
353
- === TEST 18 : get method (PUT)
370
+ === TEST 19 : get method (PUT)
354
371
-- - config
355
372
location / t {
356
373
content_by_lua_block {
@@ -369,7 +386,7 @@ get request method: PUT,
369
386
370
387
371
388
372
- === TEST 19 : get method (DELETE)
389
+ === TEST 20 : get method (DELETE)
373
390
-- - config
374
391
location / t {
375
392
content_by_lua_block {
@@ -388,7 +405,7 @@ get request method: DELETE,
388
405
389
406
390
407
391
- === TEST 20 : get schema(http2)
408
+ === TEST 21 : get schema(http2)
392
409
-- - http2
393
410
-- - config
394
411
location / t {
@@ -406,7 +423,7 @@ get request scheme: http,
406
423
407
424
408
425
409
- === TEST 21 : get header, abnormal
426
+ === TEST 22 : get header, abnormal
410
427
-- - config
411
428
location / t {
412
429
content_by_lua_block {
@@ -430,7 +447,7 @@ error status returned by host: not found
430
447
431
448
432
449
433
- === TEST 22 : set header, abnormal
450
+ === TEST 23 : set header, abnormal
434
451
-- - config
435
452
location / t {
436
453
content_by_lua_block {
@@ -451,7 +468,7 @@ location /t {
451
468
452
469
453
470
454
- === TEST 23 : get schema(http)
471
+ === TEST 24 : get schema(http)
455
472
-- - config
456
473
location / t {
457
474
content_by_lua_block {
@@ -468,7 +485,7 @@ get request scheme: http,
468
485
469
486
470
487
471
- === TEST 24 : delete pseduo headers
488
+ === TEST 25 : delete pseduo headers
472
489
-- - config
473
490
location / t {
474
491
content_by_lua_block {
@@ -489,7 +506,7 @@ can't remove pseudo header
489
506
490
507
491
508
492
- === TEST 25 : set path, abnormal
509
+ === TEST 26 : set path, abnormal
493
510
-- - config
494
511
location / t {
495
512
content_by_lua_block {
@@ -518,7 +535,7 @@ failed to set request header :path: invalid char
518
535
519
536
520
537
521
- === TEST 26 : set path
538
+ === TEST 27 : set path
522
539
-- - config
523
540
location / t {
524
541
content_by_lua_block {
@@ -549,7 +566,7 @@ a?a=c
549
566
550
567
551
568
552
- === TEST 27 : set method, abnormal
569
+ === TEST 28 : set method, abnormal
553
570
-- - config
554
571
location / t {
555
572
content_by_lua_block {
580
597
581
598
582
599
583
- === TEST 28 : set method
600
+ === TEST 29 : set method
584
601
-- - config
585
602
location / t {
586
603
content_by_lua_block {
0 commit comments