Closed goestijn closed 1 year ago
Heya. Could you maybe send in a PR we can look at? That would give us a better picture at the issue and the solution.
Solution in the pr encodes the job metrics slugs to a base64 string before the call is done to the API. By encoding the slugs presence of slashes or backslashes in the request-uri is prevented.
Seems we aren't going to change anything here right now, sorry.
Horizon Version
5.21.1
Laravel Version
9.52.15
PHP Version
8.0.26
Redis Driver
PhpRedis
Redis Version
5.3.7
Database Driver & Version
No response
Description
We are running horizon in a containerized environment on an azure app service. We are facing troubles when we try to retrieve the details of the job metrics. The call to the api request that is done on that page is returning static html instead of the appropiate json-data. The behavior does not occur on my local development environment.
I've done some research and I noticed encoded characters in the url: (../horizon/api/metrics/jobs/App%5CJobs%5CTest). I also found an article (https://learn.microsoft.com/en-us/answers/questions/1293667/azure-container-app-ingress-decoding-url) that explains azure is applying some pre-urldecoding before requests are actually reaching the app service. As a possible solution their advice is to apply double encoding. So in case in example replacing the %5C characters in the url by %255C. This approche also actually works on our environment.
Is it possible to commit a change to the library that applies double encoding to this endpoint or simply makes the endpoints more url friendly by replacing the backslashes in the url by dashes.
Steps To Reproduce