Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,10 @@ export default function getSecurityHeadersMiddleware(
res: http.ServerResponse,
next: (err?: any) => void,
) {
// @ts-ignore Property 'client' does not exist on type 'IncomingMessage', verify
const address = req.client.server.address();

// Block any cross origin request.
if (
req.headers.origin &&
req.headers.origin !== `http://localhost:${address.port}`
typeof req.headers.origin === 'string' &&
!req.headers.origin.match(/^https?:\/\/localhost:/)
) {
next(
new Error(
Expand Down