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

[Dynamic routing] Routing doesn't fail with non existing endpoint #1204

Closed
tdaghelet opened this Issue Apr 9, 2018 · 3 comments

Comments

Projects
None yet
3 participants
@tdaghelet

tdaghelet commented Apr 9, 2018

Hello,

We make dynamic routing with header like this :
{#endpoints['ENDPOINT_'+#request.headers['x-bu-code']]}/path1/path2

Sometimes, the resolved endpoint name doesn't match with any endpoint defined on the API, for example doesn't exists ENDPOINT_PLLM, and the gateway choose randomly an endpoint.

Should the gateway/dynamic routing policy not return an error if the requested endpoint name doesn't exist ?

@brasseld

This comment has been minimized.

Member

brasseld commented Apr 9, 2018

Hello @tdaghelet

You're right, it may be a good option to send a 503 service unavailable in this case.

Regards,

@tdaghelet

This comment has been minimized.

tdaghelet commented Apr 9, 2018

Ok,

Do you think it's the responsability of the policy or the gateway to verify this ?

I just reproduced in debug this problem in order to make a pull request, and for my example the SpelTemplateEngine resolve /path1/path2 as endpoint because {#endpoints['ENDPOINT_'+#request.headers['x-bu-code']]} return empty value.

Can we assume that the endpoint resolved by the policy must be start with http/https or else return a http 503 ?

@NicolasGeraud

This comment has been minimized.

Member

NicolasGeraud commented Apr 9, 2018

No, the policy allows relative path.

So I think the errors must be thrown by the #endpoints[]call.

wdyt @brasseld ?

brasseld added a commit to gravitee-io/gravitee-policy-dynamic-routing that referenced this issue Apr 10, 2018

@brasseld brasseld self-assigned this Apr 10, 2018

@brasseld brasseld added this to the 1.15.1 milestone Apr 10, 2018

@brasseld brasseld added the type: bug label Apr 10, 2018

NicolasGeraud added a commit to gravitee-io/gravitee-policy-dynamic-routing that referenced this issue Apr 10, 2018

NicolasGeraud added a commit to gravitee-io/gravitee-policy-dynamic-routing that referenced this issue Apr 10, 2018

NicolasGeraud added a commit to gravitee-io/gravitee-policy-dynamic-routing that referenced this issue Apr 10, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment