Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Forbidden 403 when make cross origin requests #31

Closed
mazzy89 opened this issue Oct 4, 2014 · 4 comments
Closed

Forbidden 403 when make cross origin requests #31

mazzy89 opened this issue Oct 4, 2014 · 4 comments

Comments

@mazzy89
Copy link

mazzy89 commented Oct 4, 2014

I have set cors to true and these are the options I'm using for the plugins:

{
  plugin: require('crumb'),
  options: {
    cookieOptions: {
      isSecure: false
    },
    allowOrigins: ['*.sendgrid.com']
  }
}

I'm using sendgrid nodejs official plugin and I make an ajax request

$.post('/server-url', data);

but I get an error. Why? is it a bug or I should set something?

@stongo
Copy link
Contributor

stongo commented Oct 9, 2014

do you have any server and client code you could post so I can help?

@stongo
Copy link
Contributor

stongo commented Dec 2, 2014

closing this until further information provided

@stongo stongo closed this as completed Dec 2, 2014
@nlindley
Copy link

nlindley commented Dec 4, 2014

We are noticing this, too. We also have the restful option set to true. The forbidden() is coming from https://github.com/hapijs/crumb/blob/master/lib/index.js#L122-L124. It works when I change it to the following, but I don’t know if this is the appropriate fix.

if (header !== request.state[request.route.plugins._crumb.key]) {
  return reply(Boom.forbidden());
}

@lock
Copy link

lock bot commented Jan 9, 2020

This thread has been automatically locked due to inactivity. Please open a new issue for related bugs or questions following the new issue template instructions.

@lock lock bot locked as resolved and limited conversation to collaborators Jan 9, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants