Skip to content

Global cors and security options not respected in 404 #3792

@erfanio

Description

@erfanio

What are you trying to achieve or the steps to reproduce?

From API docs:

If set to 'ignore', any incoming Origin header is ignored (present or not) and the 'Access-Control-Allow-Origin' header is set to '*'

I have this in my hapi server configs:

...
    routes: {
      cors: { origin: 'ignore' },
...

This works fine most of the time
image

But when a route doesn't exist, the 404 response doesn't include the cors headers.
image

What did you expect?

I expect to have access-control-allow-origin: * on the 404

Context

  • node version: 10
  • hapi version: 17.4
  • os: Linux

Metadata

Metadata

Assignees

Labels

bugBug or defect

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions