Login | Register
My pages Projects Community openCollabNet

Discussions > cvs > CVS update: MODIFIED: filter, HelmHeaders.java ...

Project highlights: Architectural Overview

joist
Discussion topic

Hide all messages in topic

All messages in topic

CVS update: MODIFIED: filter, HelmHeaders.java ...

Author stack
Full name Michael Stack
Date 2001-06-19 08:40:40 PDT
Message User: stack
  Date: 01/06/19 08:40:40

  Modified: java/org/tigris/helm​/publish/filter Tag: TIGRIS_1_0
                        HelmHeaders.java
  Log:
  Stop the carrying of 'Connection: close' headers across Noodle.
  'RFC2068 14.10 Connection' has explicit wording that Proxy's should not
  propagate 'Connection' headers (This fixes issue where people behind
  forward proxies could not view static content on tigris.org).
  
  Noodle was copying the client request headers to the proxy request twice:
  once in the joist filter CopyAllHeaders and again in the helm filter,
  HelmHeaders. Cut out the joist CopyAllHeaders filter to get rid of
  the double headers (Also means I only have to filter in one place for
  'Connection' headers).
  
  Reviewed by: Jason Robbins
  
  Revision Changes Path
  No revision
  
  http://joist.tigris.​org/source/browse/jo​ist/java/org/joist/p​ublish/Tag:
  No revision
  
  http://joist.tigris.​org/source/browse/jo​ist/java/org/joist/p​ublish/TIGRIS_1_0
  1.11.6.6 +7 -12 joist/java/org/joist​/publish/ProxyModule​.java
  
  http://joist.tigris.​org/source/browse/jo​ist/java/org/joist/p​ublish/ProxyModule.j​ava.diff?r1=1.11.6.5​&r2=1.11.6.6
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: ProxyModule.java
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/joist/java/org/jo​ist/publish/ProxyMod​ule.java,v
  retrieving revision 1.11.6.5
  retrieving revision 1.11.6.6
  diff -u -b -r1.11.6.5 -r1.11.6.6
  --- ProxyModule.java 2001/06/18 07:02:09 1.11.6.5
  +++ ProxyModule.java 2001/06/19 15:40:40 1.11.6.6
  @@ -161,8 +161,8 @@
           HttpServletRequest req = noodleData.getRequest();
           HttpServletResponse res = noodleData.getResponse();
   
  - boolean methodGet = req.getMethod().equa​lsIgnoreCase(GET);
  - boolean methodPost = req.getMethod().equa​lsIgnoreCase(POST);
  + boolean methodGET = req.getMethod().equa​lsIgnoreCase(GET);
  + boolean methodPOST = req.getMethod().equa​lsIgnoreCase(POST);
           boolean methodHEAD = req.getMethod().equa​lsIgnoreCase(HEAD);
           boolean methodPUT = req.getMethod().equa​lsIgnoreCase(PUT);
   
  @@ -233,12 +233,12 @@
           conn = new HTTPConnection(noodl​eData.getURL());
           HTTPResponse httpResponse = null;
      
  - if (methodGet)
  + if (methodGET)
           {
               httpResponse = conn.Get(sb.toString(), new String(),
                   noodleData.getHeader​sToSendAsNVPair());
           }
  - else if (methodPost)
  + else if (methodPOST)
           {
               httpResponse = conn.Post(sb.toString(), noodleData.getPostData(),
                   noodleData.getHeader​sToSendAsNVPair());
  @@ -266,16 +266,11 @@
           String ct = null;
           try
           {
  - // 'readFully' seems to have problems when a 'Connection: close'
  - // header is passed. The HTTPClient library getData( ) seems
  - // to work. St.Ack
  - // read response data from the stream
  - // data = readFully(
  - // new BufferedInputStream(
  - // noodleData.getHTTPRe​sponse().getInputStr​eam()));
  + data = readFully(
  + new BufferedInputStream( httpResponse.getInpu​tStream()));
               // i think the above line is more efficient than what
               // HTTPClient.Response is trying to do....ie:
  - data = httpResponse.getData();
  + // data = httpResponse.getData();
   
               // get the content type
               ct = httpResponse.getHead​er("Content-Type");
  
  
  
  No revision
  
  http://helm.tigris.o​rg/source/browse/hel​m/java/org/tigris/he​lm/publish/Tag:
  No revision
  
  http://helm.tigris.o​rg/source/browse/hel​m/java/org/tigris/he​lm/publish/TIGRIS_1_​0
  1.4.10.1 +2 -3 helm/java/org/tigris​/helm/publish/HelmNo​odleResources.proper​ties
  
  http://helm.tigris.o​rg/source/browse/hel​m/java/org/tigris/he​lm/publish/HelmNoodl​eResources.propertie​s.diff?r1=1.4&r2​=1.4.10.1
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HelmNoodleResources.properties
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/helm/java/org/tig​ris/helm/publish/Hel​mNoodleResources.pro​perties,v
  retrieving revision 1.4
  retrieving revision 1.4.10.1
  diff -u -b -r1.4 -r1.4.10.1
  --- HelmNoodleResources.properties 2000/12/05 21:07:03 1.4
  +++ HelmNoodleResources.properties 2001/06/19 15:40:40 1.4.10.1
  @@ -2,12 +2,11 @@
   # and then adds new filters that depend on the facility
   # added by org.tigris.helm.publish.Noodle.
   #
  -# $Id: HelmNoodleResources.​properties,v 1.4 2000/12/05 21:07:03 stack Exp $
  +# $Id: HelmNoodleResources.​properties,v 1.4.10.1 2001/06/19 15:40:40 stack Exp $
   #
   #default.port=localhost
   #default.host=80
  -prefilter.0=org.joi​st.publish.filters.C​opyAllHeaders
  -prefilter.1=org.tig​ris.helm.publish.fil​ters.HelmHeaders
  +prefilter.0=org.tig​ris.helm.publish.fil​ters.HelmHeaders
   postfilter.0=org.joi​st.publish.filters.C​opyCookies
   postfilter.1=org.tig​ris.helm.publish.fil​ters.CopyHeaders2Res​ponse
   
  
  
  
  No revision
  
  http://helm.tigris.o​rg/source/browse/hel​m/java/org/tigris/he​lm/publish/filter/Ta​g:
  No revision
  
  http://helm.tigris.o​rg/source/browse/hel​m/java/org/tigris/he​lm/publish/filter/TI​GRIS_1_0
  1.6.6.1 +11 -2 helm/java/org/tigris​/helm/publish/filter​/HelmHeaders.java
  
  http://helm.tigris.o​rg/source/browse/hel​m/java/org/tigris/he​lm/publish/filter/He​lmHeaders.java.diff?​r1=1.6&r2=1.6.6.​1
  
  (In the diff below, changes in quantity of whitespace are not shown.)
  
  Index: HelmHeaders.java
  ====================​====================​====================​=======
  RCS file: /usr/local/tigris/da​ta/helm/cvs/reposito​ry/helm/java/org/tig​ris/helm/publish/fil​ter/HelmHeaders.java​,v
  retrieving revision 1.6
  retrieving revision 1.6.6.1
  diff -u -b -r1.6 -r1.6.6.1
  --- HelmHeaders.java 2001/03/07 01:53:26 1.6
  +++ HelmHeaders.java 2001/06/19 15:40:40 1.6.6.1
  @@ -74,7 +74,7 @@
   * Modelled on org.joist.publish.fi​lter.CopyAllHeaders.​
   *
   * @author <a href="mailto:stack@c​ollab.net">St.Ack​</a>
  -* @version $Id: HelmHeaders.java,v 1.6 2001/03/07 01:53:26 lucas Exp $
  +* @version $Id: HelmHeaders.java,v 1.6.6.1 2001/06/19 15:40:40 stack Exp $
   * @see org.joist.publish.fi​lter.CopyAllHeaders
   * @see <a href="http://projects.coll​ab.net/project/eng/s​tack/projects/secure​noodle/">SecureNoodle: Problem Statement, Requirements, Survey, Decisions and Testing</a>
   */
  @@ -84,7 +84,7 @@
       /** Class version string
       */
       private static final String versionID
  - = "$Id: HelmHeaders.java,v 1.6 2001/03/07 01:53:26 lucas Exp $";
  + = "$Id: HelmHeaders.java,v 1.6.6.1 2001/06/19 15:40:40 stack Exp $";
   
   
       /** Logging object.
  @@ -203,6 +203,15 @@
                                       e.hasMoreElements(); )
           {
               header = ( ( String )e.nextElement() ).trim();
  + if( header.equalsIgnoreCase( "connection" ) )
  + {
  + // RFC2068 14.10 is explicit that proxies should not
  + // propagate 'Connection:' headers. A propagated
  + // 'Connection: close' was causing HN to throw an
  + // IOException.
  + //
  + continue;
  + }
               value = req.getHeader( header );
               if( value == null ) // make sure they have a value
                   value = "";
  
  
  

--------------------​--------------------​--------------------​---------
To unsubscribe, e-mail: cvs-unsubscribe@jois​t.tigris.org
For additional commands, e-mail: cvs-help at joist dot tigris dot org
Messages per page: