post-patch.any.js (1210B)
1 // META: global=window,worker 2 // META: title=HTTP Cache - Caching POST and PATCH responses 3 // META: timeout=long 4 // META: script=/common/utils.js 5 // META: script=/common/get-host-info.sub.js 6 // META: script=http-cache.js 7 8 var tests = [ 9 { 10 name: "HTTP cache uses content after PATCH request with response containing Content-Location and cache-allowing header", 11 requests: [ 12 { 13 request_method: "PATCH", 14 request_body: "abc", 15 response_status: [200, "OK"], 16 response_headers: [ 17 ['Cache-Control', "private, max-age=1000"], 18 ['Content-Location', ""] 19 ], 20 response_body: "abc" 21 }, 22 { 23 expected_type: "cached" 24 } 25 ] 26 }, 27 { 28 name: "HTTP cache uses content after POST request with response containing Content-Location and cache-allowing header", 29 requests: [ 30 { 31 request_method: "POST", 32 request_body: "abc", 33 response_status: [200, "OK"], 34 response_headers: [ 35 ['Cache-Control', "private, max-age=1000"], 36 ['Content-Location', ""] 37 ], 38 response_body: "abc" 39 }, 40 { 41 expected_type: "cached" 42 } 43 ] 44 } 45 ]; 46 run_tests(tests);