Prevent NPE when outMessage is null
@@ -238,7 +238,7 @@ public final class ResponseImpl extends Response {
public URI getLocation() {
Object header = metadata.getFirst(HttpHeaders.LOCATION);
- if (header == null) {
+ if (header == null && outMessage != null) {
header = outMessage.get(Message.REQUEST_URI);
}
return header == null || header instanceof URI ? (URI) header
