Skip to content
Merged
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
7 changes: 6 additions & 1 deletion libs/utils/src/main/java/com/akto/testing/ApiExecutor.java
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ private static OriginalHttpResponse sendWithRequestBody(OriginalHttpRequest requ

if (payload == null) payload = "";
if (body == null) {// body not created by GRPC block yet
if (request.getHeaders().containsKey("charset")) {
if (request.getHeaders().containsKey("charset") || isJsonRpcRequest(request)) {
body = RequestBody.create(payload, null);
request.getHeaders().remove("charset");
} else {
Expand Down Expand Up @@ -747,6 +747,7 @@ private static void closeSseSession(SseSession session) throws InterruptedExcept
}

private static boolean shouldInitiateSSEStream(OriginalHttpRequest request) {

if (!isJsonRpcRequest(request)) {
return false;
}
Expand All @@ -765,6 +766,10 @@ private static boolean shouldInitiateSSEStream(OriginalHttpRequest request) {
}
}
}
// Check if x-akto-sse-endpoint header exists, return false if it doesn't
if (request.findHeaderValue("x-akto-sse-endpoint") == null) {
return false;
}
return true;
}
}
Loading