Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
The ServeSwagger handler extracts the base path from the route by taking the beginning of the route until it finds the opening '<' and uses the extracted &str as base path to resolve incoming requests. Thus, it removes this base path from the request URI and proceeds serving with the corresponding response. Rocket also routes '/url' (note the missing trailing slash) to the handler which then panics as the base URL is shorter than request URI. This patch adds a test for the expected base path prefix and response with a redirection if missing resulting in a successful page load. Found, status code 302 or 'Moved Temporarily' is not stored in the browser. Returning this status code aims to prevent conflicts with similar routes.
- Loading branch information