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

Fix DPoP special char case #1528

Merged
merged 2 commits into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion api/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<swagger-annotations.version>1.6.8</swagger-annotations.version>
<openapi-generator.version>7.5.0</openapi-generator.version>
<openapi-generator.version>7.7.0</openapi-generator.version>
<jackson-databind-nullable.version>0.2.6</jackson-databind-nullable.version>
<jakarta-annotation.version>2.1.1</jakarta-annotation.version>
<jsr305.version>3.0.2</jsr305.version>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,6 @@
import org.slf4j.LoggerFactory;

import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URISyntaxException;
import java.net.URLDecoder;
import java.nio.charset.StandardCharsets;
import java.security.MessageDigest;
Expand Down Expand Up @@ -130,8 +128,13 @@ private void processRequest(HttpRequest request, boolean tokenRequest) {

private String getUriWithoutQueryString(HttpRequest request) {
try {
return URLDecoder.decode(StringUtils.substringBefore(request.getUri().toString(), "?"), StandardCharsets.UTF_8.name());
} catch (URISyntaxException | UnsupportedEncodingException e) {
String urlWithoutQueryString = StringUtils.substringBefore(request.getUri().toString(), "?");
return URLDecoder.decode(urlWithoutQueryString, StandardCharsets.UTF_8.name())
.replace("%", "%25") //must be replaced first
.replace(" ", "%20")
.replace("\"", "%22")
.replace("#", "%23");
} catch (Exception e) {
throw new RuntimeException(e);
}
}
Expand Down