fix(server): properly handle HEAD requests to SSR paths (#23788)
parent
2f40f5aad8
commit
0b3633db4f
|
|
@ -65,9 +65,10 @@ export class ApiService {
|
||||||
}
|
}
|
||||||
|
|
||||||
return async (request: Request, res: Response, next: NextFunction) => {
|
return async (request: Request, res: Response, next: NextFunction) => {
|
||||||
|
const method = request.method.toLowerCase();
|
||||||
if (
|
if (
|
||||||
request.url.startsWith('/api') ||
|
request.url.startsWith('/api') ||
|
||||||
request.method.toLowerCase() !== 'get' ||
|
(method !== 'get' && method !== 'head') ||
|
||||||
excludePaths.some((item) => request.url.startsWith(item))
|
excludePaths.some((item) => request.url.startsWith(item))
|
||||||
) {
|
) {
|
||||||
return next();
|
return next();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue