Fix URL encode resource's id before calling API endpoints#10292
Fix URL encode resource's id before calling API endpoints#10292traefiker merged 1 commit intotraefik:v2.11from
Conversation
021144b to
d8ea6b0
Compare
|
Hello @andsarr, and thank you for your contribution. We have tested the changes, and everything is working well. We would appreciate it if you could provide fixes for other endpoints (services, middlewares) and all UDP and TCP resources. Could you please update the pull request to include these changes? |
|
@kevinpollet sure! I'll do it! |
1fcdb0a to
fcd6c0c
Compare
|
@kevinpollet now it is ready. Since I am using a middleware for decoding the URL path parameters, I didn't need to change too many files in the backend. |
|
I don't understand why the unit tests fails in GitHub. If I execute The weirdest part is that if I run |
|
It's just a flaky test, we relaunched the check. |
|
Hello @andsarr, Thanks for the recent adjustments! The middleware could have been an elegant solution. Still, since it requires modification of the Vars map in the request context, I would prefer the previous approach to transform the parameter in each handler. Also, it would not hide that we do such a transformation. The trace log seems unnecessary as it does not provide much information, and in the Traefik code base, we do not use this level. For these reasons, it should be removed. |
|
Also, since this PR is a bug fix, can you please rebase it on the v2.10 branch? |
fcd6c0c to
0a79643
Compare
bf8f577 to
5013bbc
Compare
|
@rtribotte I have implemented all the requested changes. I have run the tests locally and they all passed. I think I am having the same issue as here #10292 (comment) |
|
Hi all! |
|
Hi @andsarr, Nothing to do on your side, maintainers need to review your PR and it will be available in the next Traefik v2.11 version |
0aea21d to
780d377
Compare
Co-authored-by: Kevin Pollet <pollet.kevin@gmail.com>
780d377 to
0333e54
Compare
|
@kevinpollet I have addressed all the comments. |
What does this PR do?
This PR fix the 404 error when a router's name contains the character
/.From the UI, when the user clicks in the table, the router's name is encoded before calling the API. In the backend, the URL path parameter is decoded before the look up.
Motivation
Fixes 10177
More
Additional Notes
Should I also decode the URL path parameter for the other API endpoints?