test421 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485
  1. <testcase>
  2. <info>
  3. <keywords>
  4. header_json
  5. </keywords>
  6. </info>
  7. #
  8. # Server-side
  9. <reply>
  10. <data crlf="yes">
  11. HTTP/1.1 200 OK
  12. server: nginx
  13. date: Tue, 07 Mar 2023 15:14:41 GMT
  14. content-type: application/json
  15. content-length: 6
  16. vary: Accept-Encoding
  17. access-control-allow-origin: *
  18. vary: Accept-Encoding
  19. referrer-policy: strict-origin-when-cross-origin
  20. access-control-allow-methods: GET, POST, PUT, DELETE, OPTIONS
  21. access-control-max-age: 1728000
  22. access-control-allow-headers: Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS
  23. access-control-expose-headers:
  24. vary: Accept
  25. etag: W/"2678f9ab2ba550d164e7cc014aefd31e"
  26. cache-control: max-age=0, private, must-revalidate
  27. x-request-id: 375b343b3d2ecf9b442c0daf00fc4a9a
  28. strict-transport-security: max-age=31536000; includeSubDomains
  29. x-content-type-options: nosniff
  30. x-xss-protection: 1; mode=block
  31. referrer-policy: strict-origin-when-cross-origin
  32. feature-policy: accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'
  33. -foo-
  34. </data>
  35. </reply>
  36. #
  37. # Client-side
  38. <client>
  39. <server>
  40. http
  41. </server>
  42. <name>
  43. HTTP GET multiple headers and %{header_json}
  44. </name>
  45. <command>
  46. http://%HOSTIP:%HTTPPORT/%TESTNUMBER -w '%{stderr}%{header_json}\n' -s
  47. </command>
  48. </client>
  49. #
  50. # Verify data after the test has been "shot"
  51. <verify>
  52. <protocol crlf="yes">
  53. GET /%TESTNUMBER HTTP/1.1
  54. Host: %HOSTIP:%HTTPPORT
  55. User-Agent: curl/%VERSION
  56. Accept: */*
  57. </protocol>
  58. <stderr mode="text">
  59. {"server":["nginx"],
  60. "date":["Tue, 07 Mar 2023 15:14:41 GMT"],
  61. "content-type":["application/json"],
  62. "content-length":["6"],
  63. "vary":["Accept-Encoding","Accept-Encoding","Accept"],
  64. "access-control-allow-origin":["*"],
  65. "referrer-policy":["strict-origin-when-cross-origin","strict-origin-when-cross-origin"],
  66. "access-control-allow-methods":["GET, POST, PUT, DELETE, OPTIONS"],
  67. "access-control-max-age":["1728000"],
  68. "access-control-allow-headers":["Authorization, Content-Type, AuthorizationOauth, X-EARLY-ACCESS"],
  69. "access-control-expose-headers":["\r"],
  70. "etag":["W/\"2678f9ab2ba550d164e7cc014aefd31e\""],
  71. "cache-control":["max-age=0, private, must-revalidate"],
  72. "x-request-id":["375b343b3d2ecf9b442c0daf00fc4a9a"],
  73. "strict-transport-security":["max-age=31536000; includeSubDomains"],
  74. "x-content-type-options":["nosniff"],
  75. "x-xss-protection":["1; mode=block"],
  76. "feature-policy":["accelerometer 'none'; camera 'none'; geolocation 'none'; gyroscope 'none'; magnetometer 'none'; microphone 'none'; payment 'none'; usb 'none'"]
  77. }
  78. </stderr>
  79. </verify>
  80. </testcase>