You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
AppEngine : bug with SimpleClientHttpResponse.getHeaders [SPR-7146] #11805
I'm trying to use @ResponseBody with Spring 3.0.2 on AppEngine
I got a RestClientException("Cannot extract response: no Content-Type found") :
from HttpMessageConverterExtractor (line 66) :
MediaType contentType = response.getHeaders().getContentType();
if (contentType == null) {
throw new RestClientException("Cannot extract response: no Content-Type found");
}
The problem comes from response.getHeaders() :
the field 0 is ignored, but with AppEngine, field 0 IS Content-Type
AppEngine uses com.google.apphosting.utils.security.urlfetch.URLFetchServiceStreamHandler$Connection as HttpURLConnection
// Header field 0 is the status line, so we start at 1
int i = 1;
while (true) {
String name = this.connection.getHeaderFieldKey(i);
if (!StringUtils.hasLength(name)) {
break;
}
this.headers.add(name, this.connection.getHeaderField(i));
i++;
}
Activity
spring-projects-issues commentedon Apr 28, 2010
Arjen Poutsma commented
Added formatting.