Mercurial > hg > nginx-tests
comparison js_headers.t @ 1776:f89770df737a
Tests: removed njs version checks older than 0.6.0.
author | Dmitry Volyntsev <xeioex@nginx.com> |
---|---|
date | Wed, 13 Jul 2022 14:55:55 -0700 |
parents | eacfd2b64b71 |
children | 410072f42157 |
comparison
equal
deleted
inserted
replaced
1775:eacfd2b64b71 | 1776:f89770df737a |
---|---|
426 like(http_get('/hdr_out?foo=12345'), qr/Foo: 12345/, 'r.headersOut'); | 426 like(http_get('/hdr_out?foo=12345'), qr/Foo: 12345/, 'r.headersOut'); |
427 like(http_get('/hdr_out?foo=123&bar=copy'), qr/Bar: 123/, 'r.headersOut get'); | 427 like(http_get('/hdr_out?foo=123&bar=copy'), qr/Bar: 123/, 'r.headersOut get'); |
428 unlike(http_get('/hdr_out?bar=empty'), qr/Bar:/, 'r.headersOut empty'); | 428 unlike(http_get('/hdr_out?bar=empty'), qr/Bar:/, 'r.headersOut empty'); |
429 unlike(http_get('/hdr_out?foo='), qr/Foo:/, 'r.headersOut no value'); | 429 unlike(http_get('/hdr_out?foo='), qr/Foo:/, 'r.headersOut no value'); |
430 unlike(http_get('/hdr_out?foo'), qr/Foo:/, 'r.headersOut no value 2'); | 430 unlike(http_get('/hdr_out?foo'), qr/Foo:/, 'r.headersOut no value 2'); |
431 | |
432 TODO: { | |
433 local $TODO = 'not yet' | |
434 unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.4.0'; | |
435 | 431 |
436 like(http_get('/content_length_keys'), qr/B:true/, 'Content-Length in keys'); | 432 like(http_get('/content_length_keys'), qr/B:true/, 'Content-Length in keys'); |
437 like(http_get('/content_length_arr'), qr/Content-Length: 3/, | 433 like(http_get('/content_length_arr'), qr/Content-Length: 3/, |
438 'set Content-Length arr'); | 434 'set Content-Length arr'); |
439 | 435 |
463 like(http_get('/hdr_out_set_cookie'), qr/B:\['c','d','f']/, | 459 like(http_get('/hdr_out_set_cookie'), qr/B:\['c','d','f']/, |
464 'set_cookie2'); | 460 'set_cookie2'); |
465 unlike(http_get('/hdr_out_set_cookie'), qr/Set-Cookie: [abe]/, | 461 unlike(http_get('/hdr_out_set_cookie'), qr/Set-Cookie: [abe]/, |
466 'set_cookie3'); | 462 'set_cookie3'); |
467 | 463 |
468 } | |
469 | |
470 like(http( | 464 like(http( |
471 'GET /hdr_in HTTP/1.0' . CRLF | 465 'GET /hdr_in HTTP/1.0' . CRLF |
472 . 'Cookie: foo' . CRLF | 466 . 'Cookie: foo' . CRLF |
473 . 'Host: localhost' . CRLF . CRLF | 467 . 'Host: localhost' . CRLF . CRLF |
474 ), qr/cookie: foo/, 'r.headersIn cookie'); | 468 ), qr/cookie: foo/, 'r.headersIn cookie'); |
504 'GET /hdr_in HTTP/1.0' . CRLF | 498 'GET /hdr_in HTTP/1.0' . CRLF |
505 . 'Content-Type: bar1' . CRLF | 499 . 'Content-Type: bar1' . CRLF |
506 . 'Content-Type: bar2' . CRLF | 500 . 'Content-Type: bar2' . CRLF |
507 . 'Host: localhost' . CRLF . CRLF | 501 . 'Host: localhost' . CRLF . CRLF |
508 ), qr/content-type: bar1(?!,\s?bar2)/, 'r.headersIn duplicate single 2'); | 502 ), qr/content-type: bar1(?!,\s?bar2)/, 'r.headersIn duplicate single 2'); |
509 | |
510 TODO: { | |
511 local $TODO = 'not yet' | |
512 unless http_get('/njs') =~ /^([.0-9]+)$/m && $1 ge '0.4.1'; | |
513 | 503 |
514 like(http( | 504 like(http( |
515 'GET /hdr_in HTTP/1.0' . CRLF | 505 'GET /hdr_in HTTP/1.0' . CRLF |
516 . 'Foo: bar1' . CRLF | 506 . 'Foo: bar1' . CRLF |
517 . 'Foo: bar2' . CRLF | 507 . 'Foo: bar2' . CRLF |
524 . 'Foo: bar2' . CRLF | 514 . 'Foo: bar2' . CRLF |
525 . 'Host: localhost' . CRLF . CRLF | 515 . 'Host: localhost' . CRLF . CRLF |
526 ), qr/raw: bar1|bar2/, 'r.rawHeadersIn'); | 516 ), qr/raw: bar1|bar2/, 'r.rawHeadersIn'); |
527 | 517 |
528 like(http_get('/raw_hdr_out?filter=a'), qr/raw: foo|bar/, 'r.rawHeadersOut'); | 518 like(http_get('/raw_hdr_out?filter=a'), qr/raw: foo|bar/, 'r.rawHeadersOut'); |
529 | |
530 } | |
531 | 519 |
532 like(http( | 520 like(http( |
533 'GET /hdr_sorted_keys?in=1 HTTP/1.0' . CRLF | 521 'GET /hdr_sorted_keys?in=1 HTTP/1.0' . CRLF |
534 . 'Cookie: foo1' . CRLF | 522 . 'Cookie: foo1' . CRLF |
535 . 'Accept: */*' . CRLF | 523 . 'Accept: */*' . CRLF |