summaryrefslogtreecommitdiffstats
path: root/src/invidious.cr
diff options
context:
space:
mode:
Diffstat (limited to 'src/invidious.cr')
-rw-r--r--src/invidious.cr8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/invidious.cr b/src/invidious.cr
index 06f9e624..96c3d6e9 100644
--- a/src/invidious.cr
+++ b/src/invidious.cr
@@ -4042,7 +4042,13 @@ get "/api/v1/annotations/:id" do |env|
annotations = response.body
end
- annotations
+ etag = sha256(annotations)[0, 16]
+ if env.request.headers["If-None-Match"]?.try &.== etag
+ env.response.status_code = 304
+ else
+ env.response.headers["ETag"] = etag
+ annotations
+ end
end
get "/api/v1/videos/:id" do |env|
cessingKotuklion 2021-07-12check host instead of the whole href for occurence of wikipedia.orgKotuklion 2021-07-12left some unnecessary spaces here and thereKotuklion 2021-07-12fix minor typosKotuklion 2021-07-12add Wikiless supportKotuklion 2021-07-11Italian translation fixunbranched 2021-07-10Add redirect for Norwegian Google TranslateTim HÄrek Andreassen 2021-07-10Bump version & update dependencies.v1.1.48SimonBrazell 2021-07-10Closes #242: remove "new" tag from SimplyTranslate.SimonBrazell 2021-06-16Fixes #238SimonBrazell 2021-06-16Redirect Twitter "video" subdomain & update dev dependencies.SimonBrazell 2021-06-16Fixed license linkGaurang Tandon 2021-06-16Added reddit.artemislena.euFantasyCookie17 2021-06-12Only append autoplay parameter if necessarybopol