1
0
Fork 0
mirror of synced 2024-06-30 12:00:41 +12:00

feat: Add canonical link http header to the static response

This commit is contained in:
Cristian 2020-07-16 12:43:22 -05:00
parent 15c1cb39e9
commit 83e5b019e4

View file

@ -107,7 +107,9 @@ class LinkDetails(View):
# slug is a timestamp # slug is a timestamp
by_ts = {page.timestamp: page for page in all_pages} by_ts = {page.timestamp: page for page in all_pages}
try: try:
return static.serve(request, archivefile, by_ts[slug].link_dir, show_indexes=True) response = static.serve(request, archivefile, by_ts[slug].link_dir, show_indexes=True)
response["Link"] = f'<{by_ts[slug].url}>; rel="canonical"'
return response
except KeyError: except KeyError:
pass pass