Uploaded image for project: 'Undertow'
  1. Undertow
  2. UNDERTOW-1183

ByteRangeHandler throws NullPointerException if Last-Modified header is missing

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 2.0.0.Beta1, 1.4.21.Final
    • 1.4.20.Final
    • Core
    • None

      ByteRangeHandler throws NullPointerException if Last-Modified header is missing in the response:

      java.lang.NullPointerException
      	at io.undertow.util.DateUtils.parseDate(DateUtils.java:135)
      	at io.undertow.server.handlers.ByteRangeHandler$2.wrap(ByteRangeHandler.java:102)
      	at io.undertow.server.handlers.ByteRangeHandler$2.wrap(ByteRangeHandler.java:91)
      	at io.undertow.server.HttpServerExchange$WrapperStreamSinkConduitFactory.create(HttpServerExchange.java:2372)
      	at io.undertow.server.HttpServerExchange.getResponseChannel(HttpServerExchange.java:1297)
      	at io.undertow.servlet.spec.ServletOutputStreamImpl.writeBufferBlocking(ServletOutputStreamImpl.java:563)
      	at io.undertow.servlet.spec.ServletOutputStreamImpl.flushInternal(ServletOutputStreamImpl.java:485)
      	at io.undertow.servlet.spec.ServletOutputStreamImpl.flush(ServletOutputStreamImpl.java:472)
      	at sun.nio.cs.StreamEncoder.implFlush(StreamEncoder.java:297)
      	at sun.nio.cs.StreamEncoder.flush(StreamEncoder.java:141)
      	at java.io.OutputStreamWriter.flush(OutputStreamWriter.java:229)
      ...
      

      RFC 7233 does not mandate the presence of Last-Modified, so the handler should simply ignore it if missing and serve the ranged response.

              sdouglas1@redhat.com Stuart Douglas (Inactive)
              heruan-1 Giovanni Lovato (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Created:
                Updated:
                Resolved: