feat: make internal objectbackend methods private

This commit is contained in:
Huskydog9988
2025-04-10 19:57:08 -04:00
parent 04c56fd985
commit dc89ff95d8
8 changed files with 67 additions and 32 deletions

View File

@ -13,7 +13,10 @@ 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.fetchHash(id);
const etagActualValue = await objectHandler.fetchHashWithWithPermissions(
id,
userId
);
if (etagRequestValue !== null && etagActualValue === etagRequestValue) {
// would compare if etag is valid, but objects should never change
setResponseStatus(h3, 304);

View File

@ -14,7 +14,10 @@ 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.fetchHash(id);
const etagActualValue = await objectHandler.fetchHashWithWithPermissions(
id,
userId
);
if (etagRequestValue !== null && etagActualValue === etagRequestValue) {
// would compare if etag is valid, but objects should never change
setResponseStatus(h3, 304);