Improve error messages in CrossDomainChannelHandler

Signed-off-by: Graham <gpe@openrs2.org>
pull/132/head
Graham 3 years ago
parent e0aefe506d
commit 493886a8bd
  1. 7
      game/src/main/kotlin/org/openrs2/game/net/crossdomain/CrossDomainChannelHandler.kt

@ -33,8 +33,11 @@ public object CrossDomainChannelHandler : SimpleChannelInboundHandler<HttpReques
// forcibly close the connection as we only expect a single request
msg.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE)
if (msg.method() != HttpMethod.GET || msg.uri() != ENDPOINT) {
Http.writeResponse(ctx, msg, HttpResponseStatus.BAD_REQUEST)
if (msg.method() != HttpMethod.GET) {
Http.writeResponse(ctx, msg, HttpResponseStatus.METHOD_NOT_ALLOWED)
return
} else if (msg.uri() != ENDPOINT) {
Http.writeResponse(ctx, msg, HttpResponseStatus.NOT_FOUND)
return
}

Loading…
Cancel
Save