mirror of
https://github.com/maciejpedzich/spotifyplaylistarchive.com.git
synced 2024-09-20 02:26:20 +02:00
Change ETag to the latest snapshot's ID
This commit is contained in:
parent
926e4ad512
commit
72dd818def
@ -49,7 +49,7 @@ export const get: APIRoute = async ({ request, params }) => {
|
||||
})
|
||||
);
|
||||
|
||||
const body = JSON.stringify(
|
||||
const payload =
|
||||
queryParams.get('allowDuplicates') === 'yes'
|
||||
? possiblyDuplicateSnapshots
|
||||
: // Since commits are sorted by the latest dateCaptured first,
|
||||
@ -62,8 +62,10 @@ export const get: APIRoute = async ({ request, params }) => {
|
||||
snapshot
|
||||
])
|
||||
).values()
|
||||
]
|
||||
);
|
||||
];
|
||||
|
||||
const body = JSON.stringify(payload);
|
||||
const ETag = payload[0].snapshotId;
|
||||
|
||||
const cacheControlDirectives =
|
||||
Date.now() > untilDate.getTime()
|
||||
@ -75,7 +77,7 @@ export const get: APIRoute = async ({ request, params }) => {
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=utf-8',
|
||||
'Cache-Control': `public, ${cacheControlDirectives}`,
|
||||
ETag: etag as string
|
||||
ETag
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
|
Loading…
Reference in New Issue
Block a user