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

middleware.push example misleading #114

Closed
naugtur opened this issue Jul 1, 2014 · 3 comments
Closed

middleware.push example misleading #114

naugtur opened this issue Jul 1, 2014 · 3 comments

Comments

@naugtur
Copy link

naugtur commented Jul 1, 2014

The example can be found in docs and Gruntfile.js as custom_middleware_patch_default_middleware

Adding a middleware using middlewares.push results in the middleware not running at all, as something earlier is ending the execution and sending out a reply.

please document adding middlewares with .unshift or smart merging into the array
or
fix the default middlewares to not end the processing.

Example of resulting confusion:
https://stackoverflow.com/questions/22992931/grunt-contrib-connect-middleware-cors-solution-with-keepalive-true/24508523

@warpdesign
Copy link
Contributor

👍

@vladikoff
Copy link
Member

Anyone want to PR this? @notthetup @warpdesign @naugtur ? Make sure to edit https://github.com/gruntjs/grunt-contrib-connect/tree/master/docs and run grunt

warpdesign added a commit to warpdesign/grunt-contrib-connect that referenced this issue Jul 24, 2014
Replaced middlewares.push() with middlewares.unshift() since with push() the middleware won't run at all.
warpdesign added a commit to warpdesign/grunt-contrib-connect that referenced this issue Jul 24, 2014
warpdesign added a commit to warpdesign/grunt-contrib-connect that referenced this issue Jul 24, 2014
@naugtur
Copy link
Author

naugtur commented Jul 24, 2014

Oops. I thought I did, but I must have forgotten :)
Thanks. I'll update on stackoverflow.

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

No branches or pull requests

3 participants