test1561 3.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. <testcase>
  2. <info>
  3. <keywords>
  4. HTTPS
  5. HTTP
  6. HTTP GET
  7. cookies
  8. cookiejar
  9. HTTP replaced headers
  10. </keywords>
  11. </info>
  12. # Server-side
  13. <reply>
  14. <data1>
  15. HTTP/1.1 200 OK
  16. Date: Tue, 09 Nov 2010 14:49:00 GMT
  17. Server: test-server/fake
  18. Set-Cookie: super=secret; domain=example.com; path=/%TESTNUMBER; secure;
  19. Set-Cookie: supersuper=secret; domain=example.com; path=/%TESTNUMBER/login/; secure;
  20. Set-Cookie: __Secure-SID=12345; Domain=example.com
  21. Set-Cookie: __Secure-SID=12346; Secure; Domain=example.com
  22. Set-Cookie: supersupersuper=secret; __Secure-SID=12346; Secure; Domain=example.com
  23. Set-Cookie: __Host-SID=22345
  24. Set-Cookie: __Host-SID=22346; Secure
  25. Set-Cookie: __Host-SID=22347; Domain=example.com
  26. Set-Cookie: __Host-SID=22348; Domain=example.com; Path=/
  27. Set-Cookie: __Host-SID=22349; Secure; Domain=example.com; Path=/
  28. Set-Cookie: __Host-SID=12346; Secure; Path=/
  29. Content-Length: 7
  30. nomnom
  31. </data1>
  32. <data2>
  33. HTTP/1.1 200 OK
  34. Date: Tue, 09 Nov 2010 14:49:00 GMT
  35. Server: test-server/fake
  36. Set-Cookie: super=secret; domain=example.com; path=/%TESTNUMBER; httponly;
  37. Set-Cookie: super=secret; domain=example.com; path=/%TESTNUMBER/; httponly;
  38. Set-Cookie: super=secret; domain=example.com; path=/15; httponly;
  39. Set-Cookie: public=yes; domain=example.com; path=/foo;
  40. Set-Cookie: supersuper=secret; domain=example.com; path=/%TESTNUMBER/login/en;
  41. Set-Cookie: supersuper=secret; domain=example.com; path=/%TESTNUMBER/login;
  42. Set-Cookie: secureoverhttp=yes; domain=example.com; path=/%TESTNUMBER; secure;
  43. Set-Cookie: __Secure-SID=22345; Domain=example.com
  44. Set-Cookie: __Secure-SID=22346; Secure; Domain=example.com
  45. Set-Cookie: __Host-SID=32345
  46. Set-Cookie: __Host-SID=32346; Secure
  47. Set-Cookie: __Host-SID=32347; Domain=example.com
  48. Set-Cookie: __Host-SID=32348; Domain=example.com; Path=/
  49. Set-Cookie: __Host-SID=32349; Secure; Domain=example.com; Path=/
  50. Set-Cookie: __Host-SID=32350; Secure; Path=/
  51. Content-Length: 7
  52. nomnom
  53. </data2>
  54. </reply>
  55. # Client-side
  56. <client>
  57. <features>
  58. SSL
  59. </features>
  60. <server>
  61. http
  62. https
  63. </server>
  64. <name>
  65. Cookies set over HTTP can't override secure ones
  66. </name>
  67. <command>
  68. -k https://%HOSTIP:%HTTPSPORT/%TESTNUMBER0001 -L -c log/jar%TESTNUMBER.txt -H "Host: www.example.com" http://%HOSTIP:%HTTPPORT/%TESTNUMBER0002 -L -c log/jar%TESTNUMBER.txt -H "Host: www.example.com"
  69. </command>
  70. </client>
  71. <verify>
  72. <protocol>
  73. GET /%TESTNUMBER0001 HTTP/1.1
  74. Host: www.example.com
  75. User-Agent: curl/%VERSION
  76. Accept: */*
  77. GET /%TESTNUMBER0002 HTTP/1.1
  78. Host: www.example.com
  79. User-Agent: curl/%VERSION
  80. Accept: */*
  81. </protocol>
  82. <file name="log/jar%TESTNUMBER.txt" mode="text">
  83. # Netscape HTTP Cookie File
  84. # https://curl.se/docs/http-cookies.html
  85. # This file was generated by libcurl! Edit at your own risk.
  86. .example.com TRUE /foo FALSE 0 public yes
  87. www.example.com FALSE / TRUE 0 __Host-SID 12346
  88. .example.com TRUE / TRUE 0 supersupersuper secret
  89. .example.com TRUE / TRUE 0 __Secure-SID 12346
  90. .example.com TRUE /%TESTNUMBER/login/ TRUE 0 supersuper secret
  91. #HttpOnly_.example.com TRUE /15 FALSE 0 super secret
  92. </file>
  93. </verify>
  94. </testcase>