nigredo-tori opened a new issue, #574:
URL: https://github.com/apache/pekko-http/issues/574

   I'm using Akka 10.2.9, but the issue doesn't seem to have been fixed in 
Pekko as well. Sorry I don't have a reproduction example at this moment, I'm 
creating this issue to have something to reference when rolling out a patch 
that will hopefully give me a clue. :smile: 
   
   I have a piece of code like this:
   ```scala
   `Content-Disposition`.parseFromValueString(headerValue)
   ```
   
   I expect it to return an `Either`. Instead, for some input values it seems 
to throw the following exception:
   ```
   java.lang.NullPointerException: Cannot invoke "String.split(String, int)" 
because "message" is null
        at 
akka.http.scaladsl.model.ErrorInfo$.fromCompoundString(ErrorInfo.scala:65)
        at 
akka.http.impl.model.parser.HeaderParser.failure(HeaderParser.scala:77)
        at akka.http.scaladsl.model.HttpHeader$.parse(HttpHeader.scala:92)
        at 
akka.http.scaladsl.model.headers.ModeledCompanion.parseFromValueString(headers.scala:40)
           <redacted>
   ```
   It seems that there is an exception raised somewhere inside the parser that 
doesn't have its message set. 
[Here](https://github.com/akka/akka-http/blob/v10.2.9/akka-http-core/src/main/scala/akka/http/impl/model/parser/HeaderParser.scala#L77)
 we do `.getMessage`, passing `null` into `ErrorInfo.fromCompoundString`. It 
[tries to split 
it](https://github.com/akka/akka-http/blob/v10.2.9/akka-http-core/src/main/scala/akka/http/scaladsl/model/ErrorInfo.scala#L65),
 and we get an NPE.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to