Skip to content

Commit

Permalink
Use GET instead of POST for the logout
Browse files Browse the repository at this point in the history
  • Loading branch information
mackdk committed Feb 28, 2025
1 parent 7b5a8fe commit 4ed13a7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@

import org.apache.http.HttpResponse;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.cookie.Cookie;
import org.apache.http.entity.ContentType;
Expand Down Expand Up @@ -127,7 +128,7 @@ private void logout() throws IOException {
return;
}

HttpPost request = createPostRequest("auth", "logout");
HttpGet request = createGetRequest("auth", "logout");
HttpResponse response = httpClientAdapter.executeRequest(request);
int statusCode = response.getStatusLine().getStatusCode();
if (statusCode != HttpStatus.SC_OK) {
Expand Down Expand Up @@ -157,4 +158,9 @@ private HttpPost createPostRequest(String namespace, String method, Map<String,

return request;
}

private HttpGet createGetRequest(String namespace, String method) {
String url = "https://%s/rhn/manager/api/%s/%s".formatted(remoteHost, namespace.replace(".", "/"), method);
return new HttpGet(url);
}
}
1 change: 1 addition & 0 deletions java/spacewalk-java.changes.mackdk.fix-registration
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
- Update ISSv3 registration to the new logout scheme

0 comments on commit 4ed13a7

Please sign in to comment.