Skip to content
Permalink
Browse files

Create additional checks for Cache-Control header (#5) (MDQ-161)

  • Loading branch information
dshafer committed Nov 26, 2018
1 parent 20da1a7 commit 2af9988b0488954ff84b9390726b60f1bb04ee7d
Showing with 21 additions and 1 deletion.
  1. +21 −1 md-query.robot
@@ -51,7 +51,27 @@ Variables variables.py
${resp}= Conditional Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED} etag=${etag}
Should Be Equal As Strings ${resp.status_code} 304 msg=SHOULD return HTTP status code 304

# 4.2 Content Caching
4.2 Content Caching
[Tags] optional
# "Responders SHOULD include cache control information with successful
# (200 status code) responses, assuming the responder knows when
# retrieved metadata is meant to expire."
${resp}= Get Entity baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}
Should Be Equal As Strings ${resp.status_code} 200
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Success response
# "When cache controls are used only the 'max-age' directive SHOULD be used."
${directive}= Get From Dictionary ${resp.headers} cache-control
Should Start With ${directive} max-age= msg=Only the 'max-age' directive SHOULD be used

# "The responder SHOULD also include cache control information with 404 Not
# Found responses. This allows the requester to create and maintain a
# negative-response cache."
${resp}= Get Entity baseUrl=${BASE_URL} identifier=foo
Should Be Equal As Strings ${resp.status_code} 404
Dictionary Should Contain Key ${resp.headers} cache-control msg=SHOULD return Cache-Control header with Not Found response
# "When cache controls are used only the 'max-age' directive SHOULD be used."
${directive}= Get From Dictionary ${resp.headers} cache-control
Should Start With ${directive} max-age= msg=Only the 'max-age' directive SHOULD be used

4.3 Content Compression
${resp}= Get Entity With Gzip baseUrl=${BASE_URL} identifier=${ENTITY_ID_ENCODED}

0 comments on commit 2af9988

Please sign in to comment.
You can’t perform that action at this time.