@@ -6,12 +6,12 @@ Feature: Server must implement the CORS protocol for preflight requests
66
77 Scenario Outline : Pre-flight CORS request for <method> request
88 Given url testContainer.url
9- And header Origin = 'https://tester'
9+ And header Origin = config.origin
1010 And header Access-Control-Request-Method = '<method>'
1111 And header Access-Control-Request-Headers = 'X-CUSTOM, Content-Type, Accept'
1212 When method OPTIONS
1313 Then match [200, 204] contains responseStatus
14- And match header Access-Control-Allow-Origin == 'https://tester'
14+ And match header Access-Control-Allow-Origin == config.origin
1515 And match header Access-Control-Allow-Methods contains '<method>'
1616 And match header Access-Control-Allow-Headers contains 'X-CUSTOM'
1717 And match header Access-Control-Allow-Headers contains 'Content-Type'
@@ -20,14 +20,14 @@ Feature: Server must implement the CORS protocol for preflight requests
2020 And match response == ''
2121
2222 Given url testContainer.url
23- And header Origin = 'https://tester'
23+ And header Origin = config.origin
2424 And headers clients.alice.getAuthHeaders('<method>' , testContainer.url)
2525 # Demonstrates the case where a long Accept header is allowed
2626 And header Accept = 'text/turtle;q=0.9, application/rdf+xml;q=0.8, application/n-triples;q=0.8, application/n-quads;q=0.8, text/x-nquads;q=0.8, application/trig;q=0.8, text/n3;q=0.8, application/ld+json;q=0.8, application/x-binary-rdf;q=0.8, text/plain;q=0.7'
2727 * <body>
2828 When method <method>
2929 Then match <statuses> contains responseStatus
30- And match header Access-Control-Allow-Origin == 'https://tester'
30+ And match header Access-Control-Allow-Origin == config.origin
3131 And match header Access-Control-Expose-Headers != null
3232 And match header Access-Control-Expose-Headers != '*'
3333 # Check Content-Type on GET request only
@@ -44,20 +44,20 @@ Feature: Server must implement the CORS protocol for preflight requests
4444 Scenario : OPTIONS request returns headers for pre-flight check after redirect from http
4545 * configure followRedirects = false
4646 Given url testContainer.url.replace(/^https:/, 'http:' )
47- And header Origin = 'https://tester'
47+ And header Origin = config.origin
4848 And header Access-Control-Request-Method = 'POST'
4949 And header Access-Control-Request-Headers = 'X-CUSTOM, Content-Type'
5050 When method OPTIONS
5151 Then match [301, 308] contains responseStatus
5252 * def location = resolveUri(testContainer.url, karate.response.headerValues('location' )[0])
5353
5454 Given url location
55- And header Origin = 'https://tester'
55+ And header Origin = config.origin
5656 And header Access-Control-Request-Method = 'POST'
5757 And header Access-Control-Request-Headers = 'X-CUSTOM, Content-Type'
5858 When method OPTIONS
5959 Then match [200, 204] contains responseStatus
60- And match header Access-Control-Allow-Origin == 'https://tester'
60+ And match header Access-Control-Allow-Origin == config.origin
6161 And match header Access-Control-Allow-Methods contains 'POST'
6262 And match header Access-Control-Allow-Headers contains 'X-CUSTOM'
6363 And match header Access-Control-Allow-Headers contains 'Content-Type'
0 commit comments