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

🐛 re-order api middlewares: cors middleware before connect-slashes #7861

Merged
merged 1 commit into from
Jan 18, 2017

Conversation

kirrg001
Copy link
Contributor

closes #7839

  • when a browser sends a request to the API without a trialing slash, we are using connect-slashes to redirect permanently
  • but because the CORS middleware was registered after the redirect, the CORS headers got lost

Reproduced and tested the fix via browser.

@kevinansfield
Copy link
Member

@kirrg001 LGTM 👍 One really annoying linter error though 😞

@kirrg001
Copy link
Contributor Author

One really annoying linter error though 😞

😖 will fix asap

closes TryGhost#7839

- when a browser sends a request to the API without a trialing slash, we are using connect-slashes to redirect permanently
- but because the CORS middleware was registered after the redirect, the CORS headers got lost
@kirrg001
Copy link
Contributor Author

Green!

@kevinansfield kevinansfield merged commit 4a4b2f6 into TryGhost:master Jan 18, 2017
@kevinansfield kevinansfield deleted the fix/api-middleware-order branch January 18, 2017 17:36
@kirrg001 kirrg001 added the LTS label Feb 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CORS middleware should be processed before redirects
2 participants