mirror of
https://github.com/hedgedoc/hedgedoc.git
synced 2025-05-22 19:25:18 -04:00
Add etag header to last modified check of motd (#1739)
* Add etag header to last modified check of motd Signed-off-by: Tilman Vatteroth <git@tilmanvatteroth.de>
This commit is contained in:
parent
ca49eb957d
commit
20d9a15cff
2 changed files with 19 additions and 6 deletions
|
@ -32,7 +32,8 @@ export const fetchMotd = async (customizeAssetsUrl: string): Promise<void> => {
|
|||
if (response.status !== 200) {
|
||||
return
|
||||
}
|
||||
if (response.headers.get('Last-Modified') === cachedLastModified) {
|
||||
const lastModified = response.headers.get('Last-Modified') || response.headers.get('etag')
|
||||
if (lastModified === cachedLastModified) {
|
||||
return
|
||||
}
|
||||
}
|
||||
|
@ -47,9 +48,9 @@ export const fetchMotd = async (customizeAssetsUrl: string): Promise<void> => {
|
|||
|
||||
const motdText = await response.text()
|
||||
|
||||
const lastModified = response.headers.get('Last-Modified')
|
||||
const lastModified = response.headers.get('Last-Modified') || response.headers.get('etag')
|
||||
if (!lastModified) {
|
||||
log.warn("'Last-Modified' not found for motd.txt!")
|
||||
log.warn("'Last-Modified' or 'Etag' not found for motd.txt!")
|
||||
}
|
||||
|
||||
setMotd(motdText, lastModified)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue