mirror of
https://github.com/pirate/ArchiveBox.git
synced 2025-08-30 17:50:04 +02:00
Merge pull request #366 from cdvv7788/hotfix/#92
feat: Add canonical link http header to the static response
This commit is contained in:
@@ -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
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user