You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@myfaces.apache.org by so...@apache.org on 2014/07/07 19:22:35 UTC
svn commit: r1608518 -
/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
Author: sobryan
Date: Mon Jul 7 17:22:34 2014
New Revision: 1608518
URL: http://svn.apache.org/r1608518
Log:
TRINIDAD-2491
* Added an explicit connect to the Resource Servlet
Modified:
myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
Modified: myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java
URL: http://svn.apache.org/viewvc/myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java?rev=1608518&r1=1608517&r2=1608518&view=diff
==============================================================================
--- myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java (original)
+++ myfaces/trinidad/trunk/trinidad-api/src/main/java/org/apache/myfaces/trinidad/webapp/ResourceServlet.java Mon Jul 7 17:22:34 2014
@@ -240,6 +240,14 @@ public class ResourceServlet extends Htt
connection.setDoInput(true);
connection.setDoOutput(false);
+ //We need to do a connect here. Some connections, like file connections and
+ //whatnot may have header information right away. Other connections, like
+ //to external resources, will not have been able to connect until this is called.
+ //The reason this worked before is the getInputStream implicitly called the
+ //connect, but the header information which was returned would before the stream
+ //was obtained would not be avialble.
+ connection.connect();
+
_setHeaders(connection, response, loader);
InputStream in = connection.getInputStream();