-
Notifications
You must be signed in to change notification settings - Fork 114
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
Add Support & Tests for X-Forwarded-Path #320
Add Support & Tests for X-Forwarded-Path #320
Conversation
_zetta.js_ : updated to include `useXForwardedRootHeader` option when creating `HttpServer` instance. _lib/http_server.js_ : updated to include `useXForwardedRootHeader` option as part of call to `titan` _test/test_api.js_ : updated with new tests that include the new "X-Forwarded-Root" header as well as more tests for the existing "X-Forwarded-Host" header. Main additions are to parse `href` values in the response body to check expected host or root path value.
Thanks for the PR and starting this discussion. Could this been done at an api management layer in front of zetta by rewriting the response to match any new paths? My main concern would be that we are introducing a non standard header/feature. However i think with how we use hypermedia linking in Siren as well through our websocket Siren responses there could be a need for something like this in the general api community. For example here is a post on the api-craft community list with a similar issue. https://groups.google.com/forum/#!topic/api-craft/PHjQzExL_5A @kevinswiber @mdobson Any take on this? |
No additional thoughts. I think you sum up my thoughts on it as well. -Matt -- On Mon, Aug 15, 2016 at 12:09 PM, Adam Magaluk [email protected]
|
The closest thing is I vote for using |
+1 for |
I considered "path" but didn't want to imply it would also change the /server/{uuid} and other possible portions of the response. But of course I'd be happy to update my argo/argo-url-helper#4 PR and others to change it to whatever you guys think best. |
@wooliet I'll let @AdamMagaluk and @mdobson make the final decision here. If Zetta has a benevolent dictator, it's probably not me. Looking at the commit log, I'm mostly just an advisor these days, kept around mostly for historical value. ;) |
I'd prefer X-Forwarded-Path. Root has too many connotations for my liking. Anything else @AdamMagaluk https://github.com/AdamMagaluk? -Matt -- On Mon, Aug 15, 2016 at 4:38 PM, Kevin Swiber [email protected]
|
+1 for Matt's decision. Let's move forward with path in the argo packages then figure out where we need to change zetta. |
Just for the sake of listing:
Anything else I could be missing? -Matt -- On Mon, Aug 15, 2016 at 4:43 PM, Adam Magaluk [email protected]
|
The custom header checked by `argo-url-helper` has changed from `X-Forwarded-Root` to `X-Forwarded-Path`. Changes in _lib/http_server.js_ and _zetta.js_ reflect option property name passed from here to `titan` and then on to `argo-url-helper`. Also updaed are related unit tests in _test/test_api.js_.
zetta.js : updated to include
useXForwardedRootHeader
option whencreating
HttpServer
instance.lib/http_server.js : updated to include
useXForwardedRootHeader
option as part of call to
titan
test/test_api.js : updated with new tests that include the new
"X-Forwarded-Root" header as well as more tests for the existing
"X-Forwarded-Host" header. Main additions are to parse
href
valuesin the response body to check expected host or root path value.
PR depends on argo/titan#5 and argo/argo-url-helper#4