@@ -74,7 +74,22 @@ error status returned by host: not found
7474
7575
7676
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
7893-- - config
7994location / t {
8095 content_by_lua_block {
@@ -93,7 +108,7 @@ get request header: foo,
93108
94109
95110
96- === TEST 5 : get all header
111+ === TEST 6 : get all header
97112-- - config
98113location / t {
99114 content_by_lua_block {
@@ -114,10 +129,11 @@ get request header: x-api foo
114129get request header: : scheme http
115130get request header: : path / t
116131get request header: : method GET
132+ get request header: : authority localhost
117133
118134
119135
120- === TEST 6 : get all header, repeated headers
136+ === TEST 7 : get all header, repeated headers
121137-- - config
122138location / t {
123139 content_by_lua_block {
@@ -140,10 +156,11 @@ get request header: x-api bar
140156get request header: : scheme http
141157get request header: : path / t
142158get request header: : method GET
159+ get request header: : authority localhost
143160
144161
145162
146- === TEST 7 : set header
163+ === TEST 8 : set header
147164-- - config
148165location / t {
149166 access_by_lua_block {
163180
164181
165182
166- === TEST 8 : set header, missing
183+ === TEST 9 : set header, missing
167184-- - config
168185location / t {
169186 access_by_lua_block {
181198
182199
183200
184- === TEST 9 : add header
201+ === TEST 10 : add header
185202-- - config
186203location / t {
187204 access_by_lua_block {
@@ -201,7 +218,7 @@ foobar
201218
202219
203220
204- === TEST 10 : add header, missing
221+ === TEST 11 : add header, missing
205222-- - config
206223location / t {
207224 access_by_lua_block {
219236
220237
221238
222- === TEST 11 : remove header
239+ === TEST 12 : remove header
223240-- - config
224241location / t {
225242 access_by_lua_block {
239256
240257
241258
242- === TEST 12 : remove header, missing
259+ === TEST 13 : remove header, missing
243260-- - config
244261location / t {
245262 access_by_lua_block {
257274
258275
259276
260- === TEST 13 : remove header, all of it
277+ === TEST 14 : remove header, all of it
261278-- - config
262279location / t {
263280 access_by_lua_block {
278295
279296
280297
281- === TEST 14 : get path (not args)
298+ === TEST 15 : get path (not args)
282299-- - config
283300location / t {
284301 content_by_lua_block {
@@ -295,7 +312,7 @@ get request path: /t,
295312
296313
297314
298- === TEST 15 : get path (args)
315+ === TEST 16 : get path (args)
299316-- - config
300317location / t {
301318 content_by_lua_block {
@@ -314,7 +331,7 @@ get request path: /t?q=hello&a=world,
314331
315332
316333
317- === TEST 16 : get method (GET)
334+ === TEST 17 : get method (GET)
318335-- - config
319336location / t {
320337 content_by_lua_block {
@@ -331,7 +348,7 @@ get request method: GET,
331348
332349
333350
334- === TEST 17 : get method (POST )
351+ === TEST 18 : get method (POST )
335352-- - config
336353location / t {
337354 content_by_lua_block {
@@ -350,7 +367,7 @@ get request method: POST,
350367
351368
352369
353- === TEST 18 : get method (PUT)
370+ === TEST 19 : get method (PUT)
354371-- - config
355372location / t {
356373 content_by_lua_block {
@@ -369,7 +386,7 @@ get request method: PUT,
369386
370387
371388
372- === TEST 19 : get method (DELETE)
389+ === TEST 20 : get method (DELETE)
373390-- - config
374391location / t {
375392 content_by_lua_block {
@@ -388,7 +405,7 @@ get request method: DELETE,
388405
389406
390407
391- === TEST 20 : get schema(http2)
408+ === TEST 21 : get schema(http2)
392409-- - http2
393410-- - config
394411location / t {
@@ -406,7 +423,7 @@ get request scheme: http,
406423
407424
408425
409- === TEST 21 : get header, abnormal
426+ === TEST 22 : get header, abnormal
410427-- - config
411428location / t {
412429 content_by_lua_block {
@@ -430,7 +447,7 @@ error status returned by host: not found
430447
431448
432449
433- === TEST 22 : set header, abnormal
450+ === TEST 23 : set header, abnormal
434451-- - config
435452location / t {
436453 content_by_lua_block {
@@ -451,7 +468,7 @@ location /t {
451468
452469
453470
454- === TEST 23 : get schema(http)
471+ === TEST 24 : get schema(http)
455472-- - config
456473location / t {
457474 content_by_lua_block {
@@ -468,7 +485,7 @@ get request scheme: http,
468485
469486
470487
471- === TEST 24 : delete pseduo headers
488+ === TEST 25 : delete pseduo headers
472489-- - config
473490location / t {
474491 content_by_lua_block {
@@ -489,7 +506,7 @@ can't remove pseudo header
489506
490507
491508
492- === TEST 25 : set path, abnormal
509+ === TEST 26 : set path, abnormal
493510-- - config
494511location / t {
495512 content_by_lua_block {
@@ -518,7 +535,7 @@ failed to set request header :path: invalid char
518535
519536
520537
521- === TEST 26 : set path
538+ === TEST 27 : set path
522539-- - config
523540location / t {
524541 content_by_lua_block {
@@ -549,7 +566,7 @@ a?a=c
549566
550567
551568
552- === TEST 27 : set method, abnormal
569+ === TEST 28 : set method, abnormal
553570-- - config
554571location / t {
555572 content_by_lua_block {
580597
581598
582599
583- === TEST 28 : set method
600+ === TEST 29 : set method
584601-- - config
585602location / t {
586603 content_by_lua_block {
0 commit comments