Improve error messages in CrossDomainChannelHandler

Signed-off-by: Graham <gpe@openrs2.org>
bzip2
Graham 4 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 // forcibly close the connection as we only expect a single request
msg.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE) msg.headers().set(HttpHeaderNames.CONNECTION, HttpHeaderValues.CLOSE)
if (msg.method() != HttpMethod.GET || msg.uri() != ENDPOINT) { if (msg.method() != HttpMethod.GET) {
Http.writeResponse(ctx, msg, HttpResponseStatus.BAD_REQUEST) Http.writeResponse(ctx, msg, HttpResponseStatus.METHOD_NOT_ALLOWED)
return
} else if (msg.uri() != ENDPOINT) {
Http.writeResponse(ctx, msg, HttpResponseStatus.NOT_FOUND)
return return
} }

Loading…
Cancel
Save