Skip to content

Commit 8ae86c4

Browse files
make asset-exists endpoint check authentication only
1 parent 7b1608e commit 8ae86c4

File tree

1 file changed

+4
-3
lines changed
  • react_on_rails_pro/packages/node-renderer/src

1 file changed

+4
-3
lines changed

react_on_rails_pro/packages/node-renderer/src/worker.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ import { buildConfig, Config, getConfig } from './shared/configBuilder';
1515
import fileExistsAsync from './shared/fileExistsAsync';
1616
import type { FastifyInstance, FastifyReply } from './worker/types';
1717
import { performRequestPrechecks } from './worker/requestPrechecks';
18+
import { AuthBody, authenticate } from './worker/authHandler';
1819
import { handleRenderRequest, type ProvidedNewBundle } from './worker/handleRenderRequest';
1920
import handleGracefulShutdown from './worker/handleGracefulShutdown';
2021
import {
@@ -452,9 +453,9 @@ export default function run(config: Partial<Config>) {
452453
Querystring: { filename: string };
453454
Body: WithBodyArrayField<Record<string, unknown>, 'targetBundles'>;
454455
}>('/asset-exists', async (req, res) => {
455-
const precheckResult = performRequestPrechecks(req.body);
456-
if (precheckResult) {
457-
await setResponse(precheckResult, res);
456+
const authResult = authenticate(req.body as AuthBody);
457+
if (authResult) {
458+
await setResponse(authResult, res);
458459
return;
459460
}
460461

0 commit comments

Comments
 (0)