Skip to content

Commit 2c74d89

Browse files
namedgraphclaude
andcommitted
Add gzip HTTP tests for SEF file and RDF/XML response
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 1f992db commit 2c74d89

File tree

2 files changed

+43
-0
lines changed

2 files changed

+43
-0
lines changed

http-tests/misc/gzip-rdfxml.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
initialize_dataset "$END_USER_BASE_URL" "$TMP_END_USER_DATASET" "$END_USER_ENDPOINT_URL"
5+
initialize_dataset "$ADMIN_BASE_URL" "$TMP_ADMIN_DATASET" "$ADMIN_ENDPOINT_URL"
6+
purge_cache "$END_USER_VARNISH_SERVICE"
7+
purge_cache "$ADMIN_VARNISH_SERVICE"
8+
purge_cache "$FRONTEND_VARNISH_SERVICE"
9+
10+
# Test that nginx gzip compression is active for RDF/XML dynamic content
11+
12+
response=$(curl -i -k -s \
13+
-H "Accept-Encoding: gzip" \
14+
-H "Accept: application/rdf+xml" \
15+
"$END_USER_BASE_URL")
16+
17+
if ! echo "$response" | grep -qi "Content-Encoding: gzip"; then
18+
echo "Content-Encoding: gzip not found on RDF/XML response"
19+
exit 1
20+
fi
21+
22+
if ! echo "$response" | grep -q "HTTP/.* 200"; then
23+
echo "RDF/XML request did not return 200 OK"
24+
exit 1
25+
fi

http-tests/misc/gzip-sefjson.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
# Test that nginx gzip compression is active for static JSON (SEF file)
5+
6+
response=$(curl -i -k -s \
7+
-H "Accept-Encoding: gzip" \
8+
"${END_USER_BASE_URL}static/com/atomgraph/linkeddatahub/xsl/client.xsl.sef.json")
9+
10+
if ! echo "$response" | grep -qi "Content-Encoding: gzip"; then
11+
echo "Content-Encoding: gzip not found on client.xsl.sef.json"
12+
exit 1
13+
fi
14+
15+
if ! echo "$response" | grep -q "HTTP/.* 200"; then
16+
echo "client.xsl.sef.json did not return 200 OK"
17+
exit 1
18+
fi

0 commit comments

Comments
 (0)