mirror of
https://github.com/Drop-OSS/drop.git
synced 2025-11-22 12:41:10 +10:00
fix: etags and other
remove sanitize-filename because IDs are internally generated remove pulse animation on NO GAME cards add migration refactors to be inline with other stuff
This commit is contained in:
@ -13,11 +13,12 @@ export default defineEventHandler(async (h3) => {
|
||||
|
||||
// https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Headers/ETag
|
||||
const etagRequestValue = h3.headers.get("If-None-Match");
|
||||
const etagActualValue = await objectHandler.fetchHashWithWithPermissions(
|
||||
id,
|
||||
userId
|
||||
);
|
||||
if (etagRequestValue !== null && etagActualValue === etagRequestValue) {
|
||||
const etagActualValue = await objectHandler.fetchHash(id);
|
||||
if (
|
||||
etagRequestValue &&
|
||||
etagActualValue &&
|
||||
etagActualValue === etagRequestValue
|
||||
) {
|
||||
// would compare if etag is valid, but objects should never change
|
||||
setResponseStatus(h3, 304);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user