fix(api): missing trailing / route for environment-document - #15
fix(api): missing trailing / route for environment-document#15Totodore wants to merge 2 commits into
Conversation
emyller
left a comment
There was a problem hiding this comment.
Sorry for taking my previous approval back. Would you think it makes sense to ensure the intended behaviour in tests?
|
I don't really see the point because the behavior is automatically standardized for every endpoints with the |
gagantrivedi
left a comment
There was a problem hiding this comment.
err.. looks like this is breaking our tests — middleware added with Router::layer runs after routing, so the normalize layer never sees the trailing slash. We probably need to wrap the layer around the whole router instead? https://docs.rs/axum/latest/axum/middleware/index.html#rewriting-request-uri-in-middleware
Each route was duplicated manually to work with trailing slash. However the
/environment-documentpath was not. And the Rust SDK use/environment-document/leading to 404.Fix this by using the
NormalizePathLayerrather than duplicating the routes which is error prone.Side notes
Error message in the rust SDK are particularly not helpful:
Failed to update environment: Flagsmith API error: . Will retry on next interval.. I will open a PR later to fix this.Don't hesitate if this need any change.