diff --git a/core/src/main/java/org/mapfish/print/http/MfClientHttpRequestFactoryImpl.java b/core/src/main/java/org/mapfish/print/http/MfClientHttpRequestFactoryImpl.java index dc6767edc4..1feecbdeb2 100644 --- a/core/src/main/java/org/mapfish/print/http/MfClientHttpRequestFactoryImpl.java +++ b/core/src/main/java/org/mapfish/print/http/MfClientHttpRequestFactoryImpl.java @@ -201,7 +201,8 @@ protected Response executeInternal(@Nonnull final HttpHeaders headers) throws IO entityEnclosingRequest.setEntity(requestEntity); } HttpResponse response = this.client.execute(this.request, this.context); - LOGGER.debug("Response: {} -- {}", response.getStatusLine().getStatusCode(), this.getURI()); + LOGGER.debug( + "Response: {} -- {}", response.getStatusLine().getRawStatusCode(), this.getURI()); return new Response(response); } diff --git a/core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java b/core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java index d4e3e45891..9d84a43b91 100644 --- a/core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java +++ b/core/src/main/java/org/mapfish/print/map/geotools/FeaturesParser.java @@ -93,7 +93,7 @@ static final CoordinateReferenceSystem parseCoordinateReferenceSystem( requestFactory.createRequest(new URI(uri), HttpMethod.GET); try (ClientHttpResponse response = request.execute()) { - if (response.getStatusCode() == HttpStatus.OK) { + if (response.getRawStatusCode() == HttpStatus.OK.value()) { final String wkt = IOUtils.toString(response.getBody(), Constants.DEFAULT_ENCODING); try { diff --git a/core/src/main/java/org/mapfish/print/map/image/AbstractSingleImageLayer.java b/core/src/main/java/org/mapfish/print/map/image/AbstractSingleImageLayer.java index 2082c70b15..0e69ae6952 100644 --- a/core/src/main/java/org/mapfish/print/map/image/AbstractSingleImageLayer.java +++ b/core/src/main/java/org/mapfish/print/map/image/AbstractSingleImageLayer.java @@ -202,13 +202,13 @@ private boolean isResponseStatusCodeValid( final String stringBody, final String baseMetricName) throws IOException { - if (httpResponse.getStatusCode() != HttpStatus.OK) { + if (httpResponse.getRawStatusCode() != HttpStatus.OK.value()) { String message = String.format( "Invalid status code for %s (%d!=%d).With request headers:\n%s\n" + "The response was: '%s'\nWith response headers:\n%s", request.getURI(), - httpResponse.getStatusCode().value(), + httpResponse.getRawStatusCode(), HttpStatus.OK.value(), String.join("\n", Utils.getPrintableHeadersList(request.getHeaders())), httpResponse.getStatusText(), diff --git a/core/src/main/java/org/mapfish/print/map/style/ParserPluginUtils.java b/core/src/main/java/org/mapfish/print/map/style/ParserPluginUtils.java index 379aba9a80..820627edde 100644 --- a/core/src/main/java/org/mapfish/print/map/style/ParserPluginUtils.java +++ b/core/src/main/java/org/mapfish/print/map/style/ParserPluginUtils.java @@ -47,13 +47,13 @@ public static Optional