Fix location header case sensitive

This commit is contained in:
Simone Locci 2021-07-26 16:03:50 +02:00 committed by Andrew Gaul
parent d861768d49
commit 0787bb891b
1 changed files with 3 additions and 3 deletions

View File

@ -28,9 +28,9 @@ import com.google.common.base.Function;
@Singleton
public class URIParser implements Function<HttpResponse, URI> {
public URI apply(final HttpResponse from) {
if (from.getStatusCode() == 202 && from.getHeaders().containsKey("Location")){
String uri = from.getFirstHeaderOrNull("Location");
return URI.create(uri);
String locationUri;
if (from.getStatusCode() == 202 && (locationUri = from.getFirstHeaderOrNull("Location")) != null){
return URI.create(locationUri);
} else if (from.getStatusCode() == 200 || from.getStatusCode() == 204){
return null;