mirror of
https://gitlab.archlinux.org/archlinux/aurweb.git
synced 2025-02-03 10:43:03 +01:00
feat(rpc): add ETag header with md5 hash content
The ETag header can be used for client-side caching. https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/ETag Signed-off-by: Kevin Morris <kevr@0cost.org>
This commit is contained in:
parent
b3b31394e8
commit
6d376fed15
3 changed files with 33 additions and 6 deletions
|
@ -488,3 +488,11 @@ def test_rpc_ratelimit(getint: mock.MagicMock, pipeline: Pipeline):
|
|||
# The new first request should be good.
|
||||
response = make_request("/rpc?v=5&type=suggest-pkgbase&arg=big")
|
||||
assert response.status_code == int(HTTPStatus.OK)
|
||||
|
||||
|
||||
def test_rpc_etag():
|
||||
response1 = make_request("/rpc?v=5&type=suggest-pkgbase&arg=big")
|
||||
response2 = make_request("/rpc?v=5&type=suggest-pkgbase&arg=big")
|
||||
assert response1.headers.get("ETag") is not None
|
||||
assert response1.headers.get("ETag") != str()
|
||||
assert response1.headers.get("ETag") == response2.headers.get("ETag")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue