Skip to content

Commit d04eaad

Browse files
committed
[test] fix failed tests in apicast-policy-ip-check.t
Previously, header contains space or control character were considered invalid and were ignore by default. But in nginx 1.21.1, it now always returns an error instead if spaces or control characters are used in a header
1 parent e450d3f commit d04eaad

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

t/apicast-policy-ip-check.t

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -360,6 +360,8 @@ is always the valid one.
360360
[403, 200]
361361
362362
=== TEST 11: X-forwarded-for header with invalid data
363+
From 1.21.1, nginx will always returns an error if spaces or control
364+
characters are used in a header name
363365
--- configuration
364366
{
365367
"services": [
@@ -385,11 +387,9 @@ is always the valid one.
385387
}
386388
--- request
387389
GET /
388-
--- response_body
389-
IP address not allowed
390390
--- more_headers eval
391391
X-forwarded-for: ,9.9.9.9
392-
--- error_code: 403
392+
--- error_code: 400
393393
--- no_error_log
394394
[error]
395395
@@ -420,10 +420,8 @@ X-forwarded-for: ,9.9.9.9
420420
}
421421
--- request
422422
GET /
423-
--- response_body
424-
IP address not allowed
425423
--- more_headers eval
426424
X-forwarded-for: ,
427-
--- error_code: 403
425+
--- error_code: 400
428426
--- no_error_log
429427
[error]

0 commit comments

Comments
 (0)