Skip to content

Commit ccb31a0

Browse files
authored
Resolve location headers against base URL. (#110)
Fix run script interpolation. Update test subject details.
1 parent c16a731 commit ccb31a0

5 files changed

Lines changed: 16 additions & 15 deletions

File tree

protocol/cors/preflight-requests.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ Feature: Server must implement the CORS protocol for preflight requests
4949
And header Access-Control-Request-Headers = 'X-CUSTOM, Content-Type'
5050
When method OPTIONS
5151
Then match [301, 308] contains responseStatus
52-
* def location = karate.response.headerValues('location')[0]
52+
* def location = resolveUri(testContainer.url, karate.response.headerValues('location')[0])
5353

5454
Given url location
5555
And header Origin = 'https://tester'

protocol/cors/preflight.feature

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Feature: Server must support HTTP OPTIONS for CORS preflight requests
2626
And header Access-Control-Request-Headers = 'X-CUSTOM, Content-Type'
2727
When method OPTIONS
2828
Then match [301, 308] contains responseStatus
29-
* def location = karate.response.headerValues('location')[0]
29+
* def location = resolveUri(testContainer.url, karate.response.headerValues('location')[0])
3030

3131
Given url location
3232
And header Origin = 'https://tester'

protocol/writing-resource/slash-semantics-exclude.feature

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Feature: With and without trailing slash cannot co-exist
1010
Given url childContainerUrl
1111
And headers clients.alice.getAuthHeaders('PUT', childContainerUrl)
1212
And header Content-Type = 'text/turtle'
13+
And header Link = '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'
1314
When method PUT
1415
Then assert responseStatus >= 200 && responseStatus < 300
1516
@@ -60,7 +61,7 @@ Feature: With and without trailing slash cannot co-exist
6061
And header Link = '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'
6162
When method POST
6263
Then assert responseStatus >= 200 && responseStatus < 300
63-
And def childContainerUrl = karate.response.headerValues('location')[0]
64+
And def childContainerUrl = resolveUri(testContainer.url, karate.response.headerValues('location')[0])
6465
And assert childContainerUrl.endsWith('/')
6566
6667
# confirm there is no non-container resource with the same URI
@@ -87,7 +88,7 @@ Feature: With and without trailing slash cannot co-exist
8788
And request 'Hello'
8889
When method POST
8990
# this should either succeed (without using the slug) or fail as a conflict
90-
Then assert (responseStatus >= 200 && responseStatus < 300 && karate.response.headerValues('location')[0] != resourceUrl) || [409, 415].includes(responseStatus)
91+
Then assert (responseStatus >= 200 && responseStatus < 300 && resolveUri(testContainer.url, karate.response.headerValues('location')[0]) != resourceUrl) || [409, 415].includes(responseStatus)
9192
9293
Scenario: POST resource, then try container with same name
9394
Given url testContainer.url
@@ -96,7 +97,7 @@ Feature: With and without trailing slash cannot co-exist
9697
And request 'Hello'
9798
When method POST
9899
Then assert responseStatus >= 200 && responseStatus < 300
99-
And def resourceUrl = karate.response.headerValues('location')[0]
100+
And def resourceUrl = resolveUri(testContainer.url, karate.response.headerValues('location')[0])
100101
And assert !resourceUrl.endsWith('/')
101102
102103
# confirm there is no container with the same URI
@@ -122,6 +123,6 @@ Feature: With and without trailing slash cannot co-exist
122123
And header Link = '<http://www.w3.org/ns/ldp#BasicContainer>; rel="type"'
123124
When method POST
124125
# this should either succeed (without using the slug) or fail as a conflict
125-
Then assert (responseStatus >= 200 && responseStatus < 300 && karate.response.headerValues('location')[0] != resourceUrl + '/') || [409, 415].includes(responseStatus)
126+
Then assert (responseStatus >= 200 && responseStatus < 300 && resolveUri(testContainer.url, karate.response.headerValues('location')[0]) != resourceUrl + '/') || [409, 415].includes(responseStatus)
126127
127128
# TODO: Evil test to check various suffices.

run.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ then
184184
dockerargs+=('--env-file=css-creds.env' '--network=testnet')
185185
harnessargs+=('--skip-teardown')
186186
else
187-
dockerargs+=('--env-file=$envfile')
187+
dockerargs+=("--env-file=$envfile")
188188
fi
189189

190190
# optionally pull published CTH image

test-subjects.ttl

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,8 @@
2323
rdfs:comment "Access for anonymous users is not supported nor required by Solid specifications so tests that depend on this are not run."@en.
2424

2525
<ess#test-subject-release>
26-
doap:revision "2.0";
27-
doap:created "2022-06-07"^^xsd:date .
26+
doap:revision "2.1";
27+
doap:created "2023-03-28"^^xsd:date .
2828

2929
<css>
3030
a earl:Software, earl:TestSubject ;
@@ -37,8 +37,8 @@
3737
solid-test:skip "acp", "http-redirect" .
3838

3939
<css#test-subject-release>
40-
doap:revision "5.0.0" ;
41-
doap:created "2022-08-08"^^xsd:date .
40+
doap:revision "7.0.3" ;
41+
doap:created "2024-01-05"^^xsd:date .
4242

4343
<nss>
4444
a earl:Software, earl:TestSubject ;
@@ -51,8 +51,8 @@
5151
solid-test:skip "acp" .
5252

5353
<nss#test-subject-release>
54-
doap:revision "5.7.3"@en ;
55-
doap:created "2022-09-22"^^xsd:date .
54+
doap:revision "5.7.7"@en ;
55+
doap:created "2023-03-17"^^xsd:date .
5656

5757
<trinpod>
5858
a earl:Software, earl:TestSubject ;
@@ -66,5 +66,5 @@
6666
solid-test:skip "acp" .
6767

6868
<trinpod#test-subject-release>
69-
doap:revision "2.3.197"@en ;
70-
doap:created "2022-01-25"^^xsd:date .
69+
doap:revision "3.2.397"@en ;
70+
doap:created "2024-01-09"^^xsd:date .

0 commit comments

Comments
 (0)