Skip to content

Commit 0b3633d

Browse files
authored
fix(server): properly handle HEAD requests to SSR paths (#23788)
1 parent 2f40f5a commit 0b3633d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

server/src/services/api.service.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,10 @@ export class ApiService {
6565
}
6666

6767
return async (request: Request, res: Response, next: NextFunction) => {
68+
const method = request.method.toLowerCase();
6869
if (
6970
request.url.startsWith('/api') ||
70-
request.method.toLowerCase() !== 'get' ||
71+
(method !== 'get' && method !== 'head') ||
7172
excludePaths.some((item) => request.url.startsWith(item))
7273
) {
7374
return next();

0 commit comments

Comments
 (0)