Skip to content
This repository has been archived by the owner on Mar 12, 2018. It is now read-only.

Commit

Permalink
JETTY-376 allow anything but CRLF in reason string
Browse files Browse the repository at this point in the history
  • Loading branch information
gregw committed Sep 4, 2007
1 parent 72d4182 commit 0d2592e
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
1 change: 1 addition & 0 deletions VERSION.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jetty-SNAPSHOT
+ Cached user agents strings in the /org/mortbay/jetty/useragents resource
+ Make default time format for RequestLog match NCSA default
+ JETTY-311 avoid json keywords
+ JETTY-376 allow anything but CRLF in reason string
+ JETTY-398 Allow same WADI Dispatcher to be used across multiple web-app contexts
+ JETTY-400 consume CGI stderr
+ JETTY-402 keep HashUserRealm in sync with file
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -361,8 +361,11 @@ public void setResponse(int status, String reason)
for (int i=0;i<len;i++)
{
char ch = reason.charAt(i);
if (ch==' ' || Character.isJavaIdentifierPart(ch))
if (ch!='\r'&&ch!='\n')
_reason.put((byte)ch);
else

_reason.put((byte)' ');
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ public void testHTTP()
endp.reset();
fields.clear();

tr[r].build(v,hb,null,connect[c],null,chunks, fields);
tr[r].build(v,hb,"OK\r\nTest",connect[c],null,chunks, fields);
String response=endp.getOut().toString();
// System.out.println("RESPONSE: "+t+"\n"+response+(hb.isPersistent()?"...\n":"---\n"));

Expand Down Expand Up @@ -109,6 +109,9 @@ public void testHTTP()
else
assertTrue(t,hb.isPersistent() || c==2 || c==3);

if (v>9)
assertEquals("OK Test",f2);

assertTrue(t,tr[r].values[1]==null || content.length()==Integer.parseInt(tr[r].values[1]));
}
}
Expand Down Expand Up @@ -199,7 +202,6 @@ public String toString()
/* 7 */ new TR(200,"text/html",""+CONTENT.length(),CONTENT),
};


String content;
String f0;
String f1;
Expand Down

0 comments on commit 0d2592e

Please sign in to comment.