Skip to content

NullPointer on missing Location header #5

@neroux

Description

@neroux

Hi @igr,

I just got the following stacktrace.

java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.String.trim()' on a null object reference
       at jodd.http.HttpRequest.set(HttpRequest.java)
       at jodd.http.HttpRequest.send(HttpRequest.java:36)

The issue seems to have been that Jodd understood it received a redirect but apparently did not receive a Location header, hence it passed null to set() which then threw a NullPointer

set(httpResponse.location());

It would appear as if Location was not sent with all 300s, and even then, it actually seems to be an optional header in general.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions