You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe what you would like to know or do
I'm denying clients which aren't providing all neccessary information and would like to set a custom Response Header field right here, is there a way for that? So that I can provide an error message, what is missing :)
Describe the solution you'd considered
I tried to put a HttpStatusMessage in the Builder´, which didn't work 👀
@OverridepublicServerHandshakeBuilderonWebsocketHandshakeReceivedAsServer(WebSocketconn, Draftdraft,
ClientHandshakerequest) throwsInvalidDataException {
ServerHandshakeBuilderbuilder = super
.onWebsocketHandshakeReceivedAsServer(conn, draft, request);
intsuccess = 0;
for (inti = 0; i <= 10; i++) {
Stringkey = Core.getConfiguration().config().getString("socket.authenticator." + i + ".key");
Stringvalue = Core.getConfiguration().config().getString("socket.authenticator." + i + ".value");
if (key == null || value == null) continue;
if (!request.hasFieldValue(key)) continue;
if (request.getFieldValue(key).equals(value)) {
success++;
}
}
if (success != 11) {
// HERE I WANT TO SET A CUSTOM HTTP RESPONSE HEADER :)thrownewInvalidDataException(CloseFrame.POLICY_VALIDATION, "Not accepted");
}
returnbuilder;
}
The text was updated successfully, but these errors were encountered:
Describe what you would like to know or do
I'm denying clients which aren't providing all neccessary information and would like to set a custom Response Header field right here, is there a way for that? So that I can provide an error message, what is missing :)
Describe the solution you'd considered
I tried to put a HttpStatusMessage in the Builder´, which didn't work 👀
The text was updated successfully, but these errors were encountered: