summaryrefslogtreecommitdiff
path: root/tests/client-manifest-not-modified.scm
diff options
context:
space:
mode:
Diffstat (limited to 'tests/client-manifest-not-modified.scm')
-rw-r--r--tests/client-manifest-not-modified.scm28
1 files changed, 28 insertions, 0 deletions
diff --git a/tests/client-manifest-not-modified.scm b/tests/client-manifest-not-modified.scm
new file mode 100644
index 0000000..440c9b8
--- /dev/null
+++ b/tests/client-manifest-not-modified.scm
@@ -0,0 +1,28 @@
+(use-modules (webid-oidc client)
+ (webid-oidc testing)
+ (webid-oidc errors)
+ (web uri)
+ (srfi srfi-19)
+ (web request)
+ (web response)
+ (ice-9 optargs)
+ (ice-9 receive))
+
+(with-test-environment
+ "client-manifest-not-modified"
+ (lambda ()
+ (let ((handler (serve-application
+ (string->uri "https://example.com/manifest")
+ (string->uri "https://example.com/authorized"))))
+ (receive (response response-body)
+ (handler (build-request (string->uri "https://example.com/manifest"))
+ "")
+ (let ((etag (response-etag response)))
+ (unless etag
+ (exit 1))
+ (receive (second-response second-response-body)
+ (handler (build-request (string->uri "https://example.com/manifest")
+ #:headers `((if-none-match . (,etag))))
+ "")
+ (unless (eqv? (response-code second-response) 304)
+ (exit 2))))))))