test358 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTP
  5. HTTP GET
  6. Alt-Svc
  7. HTTP/2
  8. </keywords>
  9. </info>
  10. #
  11. # Server-side
  12. <reply>
  13. <data nocheck="yes">
  14. HTTP/1.1 200 OK
  15. Date: Tue, 09 Nov 2010 14:49:00 GMT
  16. Content-Length: 6
  17. Connection: close
  18. Content-Type: text/html
  19. Funny-head: yesyes
  20. Alt-Svc: h2=":%HTTP2PORT", ma=315360000; persist=0
  21. -foo-
  22. </data>
  23. </reply>
  24. #
  25. # Client-side
  26. <client>
  27. <features>
  28. alt-svc
  29. debug
  30. h2c
  31. </features>
  32. <server>
  33. http
  34. http/2
  35. </server>
  36. <name>
  37. HTTPS GET translated by alt-svc lookup to HTTP/2 GET
  38. </name>
  39. <setenv>
  40. # make debug-curl accept Alt-Svc over plain HTTP
  41. CURL_ALTSVC_HTTP="yeah"
  42. </setenv>
  43. <command>
  44. --http2 --alt-svc "log/altsvc-%TESTNUMBER" "http://%HOSTIP:%HTTPPORT/%TESTNUMBER" "http://%HOSTIP:%HTTPPORT/%TESTNUMBER"
  45. </command>
  46. <file name="log/altsvc-%TESTNUMBER">
  47. h2 %HOSTIP %HTTPPORT h2 %HOSTIP %HTTP2PORT "20290222 22:19:28" 0 0
  48. </file>
  49. </client>
  50. #
  51. # Verify data after the test has been "shot"
  52. <verify>
  53. <stdout>
  54. HTTP/1.1 101 Switching Protocols
  55. Connection: Upgrade
  56. Upgrade: h2c
  57. HTTP/2 200
  58. date: Tue, 09 Nov 2010 14:49:00 GMT
  59. content-length: 6
  60. content-type: text/html
  61. funny-head: yesyes
  62. alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0
  63. via: 1.1 nghttpx
  64. -foo-
  65. HTTP/2 200
  66. date: Tue, 09 Nov 2010 14:49:00 GMT
  67. content-length: 6
  68. content-type: text/html
  69. funny-head: yesyes
  70. alt-svc: h2=":%HTTP2PORT", ma=315360000; persist=0
  71. via: 1.1 nghttpx
  72. -foo-
  73. </stdout>
  74. <stripfile>
  75. s/^server: nghttpx.*\r?\n//
  76. # strip out the (dynamic) expire date from the file so that the rest
  77. # matches
  78. s/\"2([^\"]*)\"/TIMESTAMP/
  79. </stripfile>
  80. <file name="log/altsvc-%TESTNUMBER" mode="text">
  81. # Your alt-svc cache. https://curl.se/docs/alt-svc.html
  82. # This file was generated by libcurl! Edit at your own risk.
  83. h2 %HOSTIP %HTTPPORT h2 %HOSTIP %HTTP2PORT TIMESTAMP 0 0
  84. </file>
  85. </verify>
  86. </testcase>