The range request with Range outside of the scope should end with 416 Range Not Satisfiable in case of server supporting ranges, see https://tools.ietf.org/html/rfc7233#section-4.4.
In case of Range send outside of the scope, it fails with sending empty response and failing with [1] on server shutdown. (Range: 11-12 on attached application)
In case of Range in wrong order (higher-lower) it returns 200 and all data. (Range: 7-5 on attached application)
In both cases there should be returned 416 and Content-Range specifying the current length of the selected representation.
[1]
16:31:07,296 ERROR [org.xnio.listener] (default I/O-8) XNIO001007: A channel event listener threw an exception: java.util.concurrent.RejectedExecutionException: XNIO007007: Thread is terminating at org.xnio.nio.WorkerThread.executeAfter(WorkerThread.java:615) at io.undertow.server.protocol.ParseTimeoutUpdater.handleSchedule(ParseTimeoutUpdater.java:85) at io.undertow.server.protocol.ParseTimeoutUpdater.connectionIdle(ParseTimeoutUpdater.java:64) at io.undertow.server.protocol.http.HttpReadListener.newRequest(HttpReadListener.java:113) at io.undertow.server.protocol.http.HttpReadListener.exchangeComplete(HttpReadListener.java:289) at io.undertow.server.protocol.http.HttpServerConnection.exchangeComplete(HttpServerConnection.java:228) at io.undertow.server.HttpServerExchange$ExchangeCompleteNextListener.proceed(HttpServerExchange.java:1802) at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler$1.exchangeEvent(GlobalRequestControllerHandler.java:25) at io.undertow.server.HttpServerExchange.invokeExchangeCompleteListeners(HttpServerExchange.java:1222) at io.undertow.server.HttpServerExchange.closeAndFlushResponse(HttpServerExchange.java:1639) at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1629) at io.undertow.server.AbstractServerConnection$CloseSetter.handleEvent(AbstractServerConnection.java:316) at io.undertow.server.AbstractServerConnection$CloseSetter.handleEvent(AbstractServerConnection.java:296) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.StreamConnection.invokeCloseListener(StreamConnection.java:80) at org.xnio.Connection.readClosed(Connection.java:94) at org.xnio.nio.AbstractNioStreamConnection.readClosed(AbstractNioStreamConnection.java:43) at org.xnio.nio.NioSocketConduit.terminateReads(NioSocketConduit.java:311) at org.xnio.conduits.AbstractSourceConduit.terminateReads(AbstractSourceConduit.java:42) at org.xnio.conduits.ConduitStreamSourceChannel.close(ConduitStreamSourceChannel.java:168) at org.xnio.IoUtils.safeClose(IoUtils.java:134) at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.forceTermination(ReadReadyHandler.java:58) at org.xnio.nio.NioSocketConduit.forceTermination(NioSocketConduit.java:105) at org.xnio.nio.WorkerThread.run(WorkerThread.java:492) 16:31:07,297 ERROR [org.xnio.listener] (default I/O-1) XNIO001007: A channel event listener threw an exception: java.util.concurrent.RejectedExecutionException: XNIO007007: Thread is terminating at org.xnio.nio.WorkerThread.executeAfter(WorkerThread.java:615) at io.undertow.server.protocol.ParseTimeoutUpdater.handleSchedule(ParseTimeoutUpdater.java:85) at io.undertow.server.protocol.ParseTimeoutUpdater.connectionIdle(ParseTimeoutUpdater.java:64) at io.undertow.server.protocol.http.HttpReadListener.newRequest(HttpReadListener.java:113) at io.undertow.server.protocol.http.HttpReadListener.exchangeComplete(HttpReadListener.java:289) at io.undertow.server.protocol.http.HttpServerConnection.exchangeComplete(HttpServerConnection.java:228) at io.undertow.server.HttpServerExchange$ExchangeCompleteNextListener.proceed(HttpServerExchange.java:1802) at org.wildfly.extension.undertow.deployment.GlobalRequestControllerHandler$1.exchangeEvent(GlobalRequestControllerHandler.java:25) at io.undertow.server.HttpServerExchange.invokeExchangeCompleteListeners(HttpServerExchange.java:1222) at io.undertow.server.HttpServerExchange.closeAndFlushResponse(HttpServerExchange.java:1639) at io.undertow.server.HttpServerExchange.endExchange(HttpServerExchange.java:1629) at io.undertow.server.AbstractServerConnection$CloseSetter.handleEvent(AbstractServerConnection.java:316) at io.undertow.server.AbstractServerConnection$CloseSetter.handleEvent(AbstractServerConnection.java:296) at org.xnio.ChannelListeners.invokeChannelListener(ChannelListeners.java:92) at org.xnio.StreamConnection.invokeCloseListener(StreamConnection.java:80) at org.xnio.Connection.readClosed(Connection.java:94) at org.xnio.nio.AbstractNioStreamConnection.readClosed(AbstractNioStreamConnection.java:43) at org.xnio.nio.NioSocketConduit.terminateReads(NioSocketConduit.java:311) at org.xnio.conduits.AbstractSourceConduit.terminateReads(AbstractSourceConduit.java:42) at org.xnio.conduits.ConduitStreamSourceChannel.close(ConduitStreamSourceChannel.java:168) at org.xnio.IoUtils.safeClose(IoUtils.java:134) at org.xnio.conduits.ReadReadyHandler$ChannelListenerHandler.forceTermination(ReadReadyHandler.java:58) at org.xnio.nio.NioSocketConduit.forceTermination(NioSocketConduit.java:105) at org.xnio.nio.WorkerThread.run(WorkerThread.java:492)