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

Custom error templates only work with APIs that are not tracked #438

Closed
lonelycode opened this issue Feb 1, 2017 · 1 comment
Closed
Assignees
Labels
Milestone

Comments

@lonelycode
Copy link
Member

Do you want to request a feature or report a bug?
bug

What is the current behavior?
Using a custom error template error_401.json does not return the custom error unless the API has "do_not_track": true set.

What is the expected behavior?
The gateway should respond with custom errors regardless of the tracking status of the API Definition.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem

  1. Create a custom error template error_403.json in templates:
{
  "custom_error": "YOU SHALL NOT PASS!"
} 
  1. Create a new API that uses token authentication

  2. Access that API with a non-existent token:

curl -X GET -H "Authorization: Foo" -H "Content-Type: application/json" http://10.0.75.2:8181/test/get
  1. Check the error that gets returned, it will be the dfault template, not your custom one.

Which versions of Tyk affected by this issue? Did this work in previous versions of Tyk?
2.2

@buger
Copy link
Member

buger commented Nov 15, 2017

Looks like it was fixed in #546

@buger buger closed this as completed Nov 15, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants