cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpRequestAdapter.java

2001-01-13 Thread nacho

nacho   01/01/13 10:36:27

  Modified:src/share/org/apache/tomcat/service/http Tag: tomcat_32
HttpRequestAdapter.java
  Log:
  Bug Report #743
  request.getServerPort() reports wrong port with SSL (https)
  Submitted by Andreas Schildbach  [EMAIL PROTECTED]
  Patch by Dimitris Dinodimos [[EMAIL PROTECTED]]
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.16.2.6  +17 -15
jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpRequestAdapter.java
  
  Index: HttpRequestAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpRequestAdapter.java,v
  retrieving revision 1.16.2.5
  retrieving revision 1.16.2.6
  diff -u -r1.16.2.5 -r1.16.2.6
  --- HttpRequestAdapter.java   2001/01/12 04:27:04 1.16.2.5
  +++ HttpRequestAdapter.java   2001/01/13 18:36:27 1.16.2.6
  @@ -247,21 +247,23 @@
   }
   
   public int getServerPort() {
  -if(serverPort == -1) {
  -//XXX Which is the default in case we can not get the port
  -//from the request??
  -serverPort=socket.getLocalPort();
  -String hostHeader = this.getHeader("host");
  -if (hostHeader != null) {
  -int i = hostHeader.indexOf(':');
  -if (i > -1) {
  -hostHeader = hostHeader.substring(i+1);
  -try{
  -serverPort=Integer.parseInt(hostHeader);
  -}catch(NumberFormatException pex){
  -}
  -}else serverPort=80;
  -}
  +if (serverPort != -1)
  +return serverPort;
  +String hostHeader = this.getHeader("host");
  +if (hostHeader == null)
  +serverPort = socket.getLocalPort();
  +else {
  +int i = hostHeader.indexOf(':');
  +if (i > -1) {
  +hostHeader = hostHeader.substring(i+1);
  +try {
  +serverPort = Integer.parseInt(hostHeader);
  +} catch (NumberFormatException pex) {
  +}
  +} else if (isSecure())
  +serverPort = 443;
  +else
  +serverPort = 80;
   }
   return serverPort;
   }
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpRequestAdapter.java

2001-01-11 Thread larryi

larryi  01/01/11 20:27:04

  Modified:src/share/org/apache/tomcat/service/http Tag: tomcat_32
HttpRequestAdapter.java
  Log:
  Clear the protocal for bad request with only one "word", otherwise we will
  attempt to read headers.
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.16.2.5  +1 -0  
jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpRequestAdapter.java
  
  Index: HttpRequestAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpRequestAdapter.java,v
  retrieving revision 1.16.2.4
  retrieving revision 1.16.2.5
  diff -u -r1.16.2.4 -r1.16.2.5
  --- HttpRequestAdapter.java   2000/12/20 16:17:41 1.16.2.4
  +++ HttpRequestAdapter.java   2001/01/12 04:27:04 1.16.2.5
  @@ -368,6 +368,7 @@
// we don't have 2 "words", probably only method
// startReq>0 => method is fine, request has at least one char
response.setStatus(HttpServletResponse.SC_BAD_REQUEST);
  + protocol=null;
return;
}

  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, email: [EMAIL PROTECTED]




cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpRequestAdapter.java

2000-12-20 Thread nacho

nacho   00/12/20 08:17:43

  Modified:src/share/org/apache/tomcat/service/http Tag: tomcat_32
HttpRequestAdapter.java
  Log:
  BugReport#513  Anonymous
  (Security)Problem accessing via HTTP without protocol
  
  BugReport#619 Robert Ellis ( [EMAIL PROTECTED]  )
  JSP Source Disclosure
  
  BugReport#620  Mark Brouwer ( [EMAIL PROTECTED]  
)
  getProtocol() method on ServletRequest includes CRLF causing problems
  
  Submitted by Kazuhiro Kazama [[EMAIL PROTECTED]]
  
  PS: More patches like this please,  3 Bad Boys with only 1 bullet :-)
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.16.2.4  +7 -4  
jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpRequestAdapter.java
  
  Index: HttpRequestAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/Attic/HttpRequestAdapter.java,v
  retrieving revision 1.16.2.3
  retrieving revision 1.16.2.4
  diff -u -r1.16.2.3 -r1.16.2.4
  --- HttpRequestAdapter.java   2000/11/10 02:48:40 1.16.2.3
  +++ HttpRequestAdapter.java   2000/12/20 16:17:41 1.16.2.4
  @@ -303,7 +303,9 @@
   private  final int skipSpaces() {
while (off < count) {
if ((buf[off] != (byte) ' ') 
  - && (buf[off] != (byte) '\t')) {
  + && (buf[off] != (byte) '\t')
  + && (buf[off] != (byte) '\r')
  + && (buf[off] != (byte) '\n')) {
return off;
}
off++;
  @@ -316,7 +318,9 @@
   private  int findSpace() {
while (off < count) {
if ((buf[off] == (byte) ' ') 
  - || (buf[off] == (byte) '\t')) {
  + || (buf[off] == (byte) '\t')
  + || (buf[off] == (byte) '\r')
  + || (buf[off] == (byte) '\n')) {
return off;
}
off++;
  @@ -369,9 +373,8 @@

method= new String( buf, startMethod, endMethod - startMethod );
   
  - if( endReq < 0 ) {
  + if( startProto < 0 ) {
protocol=null;
  - endReq=count;
} else {
if( endProto < 0 ) endProto = count;
protocol=new String( buf, startProto, endProto-startProto );
  
  
  



cvs commit: jakarta-tomcat/src/share/org/apache/tomcat/service/http HttpRequestAdapter.java

2000-11-09 Thread nacho

nacho   00/11/09 18:48:41

  Modified:src/share/org/apache/tomcat/service/http Tag: tomcat_32
HttpRequestAdapter.java
  Log:
  * Fixing a problem with redirections,  was using the lsocket port
  not the host header port if present
  
  Revision  ChangesPath
  No   revision
  
  
  No   revision
  
  
  1.16.2.3  +17 -1 
jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java
  
  Index: HttpRequestAdapter.java
  ===
  RCS file: 
/home/cvs/jakarta-tomcat/src/share/org/apache/tomcat/service/http/HttpRequestAdapter.java,v
  retrieving revision 1.16.2.2
  retrieving revision 1.16.2.3
  diff -u -r1.16.2.2 -r1.16.2.3
  --- HttpRequestAdapter.java   2000/10/04 20:23:57 1.16.2.2
  +++ HttpRequestAdapter.java   2000/11/10 02:48:40 1.16.2.3
  @@ -247,7 +247,23 @@
   }
   
   public int getServerPort() {
  -return socket.getLocalPort();
  +if(serverPort == -1) {
  +//XXX Which is the default in case we can not get the port
  +//from the request??
  +serverPort=socket.getLocalPort();
  +String hostHeader = this.getHeader("host");
  +if (hostHeader != null) {
  +int i = hostHeader.indexOf(':');
  +if (i > -1) {
  +hostHeader = hostHeader.substring(i+1);
  +try{
  +serverPort=Integer.parseInt(hostHeader);
  +}catch(NumberFormatException pex){
  +}
  +}else serverPort=80;
  +}
  +}
  +return serverPort;
   }
   
   public String getServerName() {
  
  
  

-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]