Skip to content

rewriteCookiePath option, to rewrite the "Path" from "Set-Cookie" response headers#32

Closed
gil wants to merge 2 commits intodrewzboto:masterfrom
gil:rewrite_cookie_path
Closed

rewriteCookiePath option, to rewrite the "Path" from "Set-Cookie" response headers#32
gil wants to merge 2 commits intodrewzboto:masterfrom
gil:rewrite_cookie_path

Conversation

@gil
Copy link

@gil gil commented Oct 25, 2013

No description provided.

@drewzboto
Copy link
Owner

Thanks, appreciate the PR. Let me think a bit on how we can make the rewrite configuration a bit nicer (for both the rewrite and cookie). I'd prefer to make it obvious those to aspects are related

@gil
Copy link
Author

gil commented Oct 25, 2013

Cool! I'll try to think about it here and how it can be better implemented.

@gil
Copy link
Author

gil commented Oct 25, 2013

Maybe something like this?

rewrite: [
    new ContextRewrite('^/changingcontext', '/anothercontext'),
    new ContextRewrite('^/api', '/api2')
    new CookiePathRewrite('^/api', '/')
]

@drewzboto
Copy link
Owner

If we could provide standard functions instead of using a new instance, that would work nicely. That would also allow people to tuck in their own functions that aren't OOTB.

var proxyUtils = require("./lib/utils.js");
...
rewrite: [
proxyUtils.rewriteContext(...),
proxyUtils.rewriteCookie(...),
function () { ... }
]

This would be a breaking change to the rewrite configuration. But probably worth it for the extra flexibility.

@rrarunan
Copy link

Is there an update on the rewrite cookie functionality?

@drewzboto
Copy link
Owner

should have something out over the holidays

@hco
Copy link

hco commented Jan 17, 2014

Any progress on this? :)

@solidstudio
Copy link

also interested in this.

@drewzboto
Copy link
Owner

Sorry, still on my plate. 2014 started off a bit crazy, haven't had much time to dedicate to this project. Should expect things to slow down shortly to give this another kick.

@anton-rodin
Copy link

Come on guys, I can't live without this feature. Please Implement cookieRewrite

@gil
Copy link
Author

gil commented Feb 17, 2014

Hi guys, can anyone check my new pull request? I've updated it to the newer version and with the syntax discussed here. I just didn't have the time to do better testing, so please help me test it before accepting the pull request.

You can add to your "package.json":

"grunt-connect-proxy": "git+https://github.com/gil/grunt-connect-proxy.git#rewrites_new"

@gil
Copy link
Author

gil commented Feb 17, 2014

Also, I've changed in a way that it will still support the old syntax, so it won't break current users.

@drewzboto
Copy link
Owner

Thanks for the update! I'm not too concerned about the old syntax, i think we'll have to go this route for the next major version. let me give this a spin over the next week or so.

@gil
Copy link
Author

gil commented Feb 17, 2014

If you don't want to support the old syntax, just remove these lines: https://github.com/gil/grunt-connect-proxy/blob/10a6ca6e886fdaf4444e7eaff410640e22bf8760/lib/utils.js#L81-L90

I'll try to do better testing during the week. If you need anything, just let me know.

@drewzboto drewzboto added this to the 0.2.0 milestone Mar 11, 2014
@drewzboto
Copy link
Owner

Committed as part of #50 in 0.2.x branch. Will track in #50

@drewzboto drewzboto closed this Mar 11, 2014
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.

6 participants