-
Type: Bug
-
Status: Resolved
-
Priority: Minor
-
Resolution: Fixed
-
Affects Version/s: None
-
Fix Version/s: 10.10-HF54, 11.4, 2021.0
-
Component/s: File Upload
-
Release Notes Summary:Batch upload "Resume Incomplete" returns HTTP 202
-
Impact type:API change
-
Upgrade notes:
-
Team:FG
-
Sprint:nxplatform #46
-
Story Points:2
Our BatchUpload mechanism uses code 308 to express "Resume Incomplete" which means that a chunked upload is not yet finished (see class BatchUploadObject). This use of 308 was inspired by the Google Drive REST API, however it was non-standard and now 308 has another official meaning of Permanent Redirect (yet another variant).
RFC 7238 has normalized this meaning of "Permanent Redirect".
Some libraries (like Apache httpclient 4.5.12) now therefore expect any 308 response to have a Location header, which our 308 responses don't have.
This will cause problems in the future (in actually prevents us from upgrading to httpclient 4.5.12 without test code changes, see below), so we should think about another status code for this use in chunked upload, and change our client sdks to understand a new one.
com.sun.jersey.api.client.ClientHandlerException: org.apache.http.client.ClientProtocolException at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:187) at com.sun.jersey.api.client.filter.HTTPBasicAuthFilter.handle(HTTPBasicAuthFilter.java:105) at com.sun.jersey.api.client.Client.handle(Client.java:652) at com.sun.jersey.api.client.WebResource.handle(WebResource.java:682) at com.sun.jersey.api.client.WebResource.access$200(WebResource.java:74) at com.sun.jersey.api.client.WebResource$Builder.get(WebResource.java:509) at org.nuxeo.ecm.restapi.test.BaseTest.getResponse(BaseTest.java:178) at org.nuxeo.ecm.restapi.test.BaseTest.getResponse(BaseTest.java:125) at org.nuxeo.ecm.restapi.test.BatchUploadFixture.testChunkedUpload(BatchUploadFixture.java:464) Caused by: org.apache.http.client.ClientProtocolException at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:187) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:72) at org.apache.http.impl.client.CloseableHttpClient.execute(CloseableHttpClient.java:56) at com.sun.jersey.client.apache4.ApacheHttpClient4Handler.handle(ApacheHttpClient4Handler.java:171) ... 70 more Caused by: org.apache.http.ProtocolException: Received redirect response HTTP/1.1 308 but no location header at org.apache.http.impl.client.DefaultRedirectStrategy.getLocationURI(DefaultRedirectStrategy.java:148) at org.apache.http.impl.client.DefaultRedirectStrategy.getRedirect(DefaultRedirectStrategy.java:223) at org.apache.http.impl.execchain.RedirectExec.execute(RedirectExec.java:126) at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:185) ... 73 more