-
Notifications
You must be signed in to change notification settings - Fork 170
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
[THREESCALE-1150] Add option to use only path-based routing #1035
Conversation
doc/parameters.md
Outdated
- `true` or `1` for _true_ | ||
- `false`, `0` or empty for _false_ | ||
|
||
When this parameter is set to _true_, the gateway will use path-based routing and will not fallback to the default host-based routing. The API request will be routed to the first service that has a matching mapping rule, from the list of services for which the value of the `Host` header of the request matches the _Public Base URL_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When this parameter is set to _true_, the gateway will use path-based routing and will not fallback to the default host-based routing. The API request will be routed to the first service that has a matching mapping rule, from the list of services for which the value of the `Host` header of the request matches the _Public Base URL_. | |
When this parameter is set to _true_, the gateway uses path-based routing and does not fallback to the default host-based routing. The API request is routed to the first service that has a matching mapping rule, from the list of services for which the value of the `Host` header of the request matches the _Public Base URL_. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changed 👍
Thanks for the review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggested a change.
23b4227
to
e991c9b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm ok with the change, integration tests have good coverage so you can skip my comment in the unittest.
Regards
end) | ||
|
||
it('stores nil in the context even if there is a service for the host', function() | ||
local service = { id = '1' } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A quick comment, shouldn't need to test with more than one service?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not really needed. This module only cares about what the HostBasedFinder
and the PathBasedFinder
modules return and they just return one service. In those 2 modules we have tests with configurations that have multiple services, so I think we are covered.
While at it, removed the unnecessary checks like the ones related with caching internals that are not related with this functionality. Also, made the second test clearer by making sure that both services return different error codes for the "No mapping rules matched" error.
e991c9b
to
7e4e6cf
Compare
Rebased on top of master to solve conflicts in the changelog. |
Reference: https://issues.jboss.org/browse/THREESCALE-1150
This PR adds a new env,
APICAST_PATH_ROUTING_ONLY
. When set to true, the gateway will use path-based routing and will not fallback to the default host-based routing, which is what happens when usingAPICAST_PATH_ROUTING
.