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

Revert "Decode path for createElementInDirectoryPath endpoint" #157

Merged
merged 1 commit into from
Aug 1, 2024

Conversation

antoinebhs
Copy link
Contributor

@antoinebhs antoinebhs commented Aug 1, 2024

Reverts #156: the issue arises because the path is encoded twice when the request is built in case-import-server (gridsuite/case-import-server#15), not because it's not decoded in directory-server.
This double encoding seems to be repeated in other places in our codebase when building a URI.
The pattern is the following where a first encoding is done in:

        String path = UriComponentsBuilder
                .fromPath([...])
                .queryParam([...])
                .toUriString(); // encoded here

And a second one when using restTemplate.exchange()
There are other places in our code where we decode while we should probably just not encode twice:
https://github.com/gridsuite/loadflow-server/blob/32904c78c88b4fcee92108581acfbab1b9a2d24a/src/main/java/org/gridsuite/loadflow/server/LoadFlowController.java#L85

Copy link

sonarqubecloud bot commented Aug 1, 2024

@antoinebhs antoinebhs merged commit f301a99 into main Aug 1, 2024
4 checks passed
@antoinebhs antoinebhs deleted the revert-156-fix-encoding-case-import branch August 1, 2024 14:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants