Skip to content

Commit 9abf324

Browse files
committed
Fix an issue with OAuth due to the HTTP2 not setting the Content-Type header to application/x-www-form-urlencoded
1 parent 5e2b90b commit 9abf324

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/main/java/org/openstreetmap/josm/plugins/mapillary/oauth/OAuthPortListener.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public void run() {
8080
client.setHeader("Authorization", "OAuth " + MapillaryConfig.getUrls().getClientSecret());
8181
client.setRequestBody(("grant_type=authorization_code&client_id=" + MapillaryConfig.getUrls().getClientId()
8282
+ "&code=" + authorizationCode).getBytes(StandardCharsets.UTF_8));
83+
client.setHeader("Content-Type", "application/x-www-form-urlencoded");
8384

8485
final HttpClient.Response response = client.connect();
8586
try (JsonReader jsonReader = Json.createReader(response.getContentReader())) {

0 commit comments

Comments
 (0)