www-apache-bugdb mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael "Röschter" <Michael.roesch...@dynaware.de>
Subject mod_jserv/4640: Reload of servlet page with date-modified set results in date parse exception
Date Wed, 23 Jun 1999 16:18:23 GMT

>Number:         4640
>Category:       mod_jserv
>Synopsis:       Reload of servlet page with date-modified set results in date parse exception
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    jserv
>State:          open
>Class:          sw-bug
>Submitter-Id:   apache
>Arrival-Date:   Wed Jun 23 09:20:00 PDT 1999
>Last-Modified:
>Originator:     Michael.roeschter@dynaware.de
>Organization:
apache
>Release:        1.3.6/1.0
>Environment:
Suse Linux Kernel 2.036 
Apache 1.3.6
Jserv 1.0
JDK 1.2 pre release
Browser: Netscape 4.5 under NT4.0
>Description:
The getDateHeader method will throw a parse exception if a 
if-modified-since header is present

(more detail in the "how can we repeat this problem" category)

Here follows an excerpt from the jserv.log

[23/06/1999 17:30:35:822 GMT+02:00] Connection from localhost/127.0.0.1
[23/06/1999 17:30:35:825 GMT+02:00] Initializing servlet request
[23/06/1999 17:30:35:827 GMT+02:00] Reading request data
[23/06/1999 17:30:35:828 GMT+02:00] Will read 17 bytes for this line
[23/06/1999 17:30:35:830 GMT+02:00] Read: Ctimesheet	tsheet
[23/06/1999 17:30:35:831 GMT+02:00] Servlet Zone: timesheet Servlet: tsheet
[23/06/1999 17:30:35:838 GMT+02:00] Will read 14 bytes for this line
[23/06/1999 17:30:35:839 GMT+02:00] Read: S192.168.255.3
[23/06/1999 17:30:35:841 GMT+02:00] Hostname: 192.168.255.3
[23/06/1999 17:30:35:842 GMT+02:00] Will read 40 bytes for this line
[23/06/1999 17:30:35:844 GMT+02:00] Read: EDOCUMENT_ROOT	/web/192.168.255.3/htdocs
[23/06/1999 17:30:35:845 GMT+02:00] Env: DOCUMENT_ROOT=/web/192.168.255.3/htdocs
[23/06/1999 17:30:35:846 GMT+02:00] Will read 26 bytes for this line
[23/06/1999 17:30:35:848 GMT+02:00] Read: EGATEWAY_INTERFACE	CGI/1.1
[23/06/1999 17:30:35:849 GMT+02:00] Env: GATEWAY_INTERFACE=CGI/1.1
[23/06/1999 17:30:35:851 GMT+02:00] Will read 35 bytes for this line
[23/06/1999 17:30:35:852 GMT+02:00] Read: EPATH	/sbin:/bin:/usr/sbin:/usr/bin
[23/06/1999 17:30:35:853 GMT+02:00] Env: PATH=/sbin:/bin:/usr/sbin:/usr/bin
[23/06/1999 17:30:35:855 GMT+02:00] Will read 22 bytes for this line
[23/06/1999 17:30:35:856 GMT+02:00] Read: EPATH_INFO	/loginsfgsd
[23/06/1999 17:30:35:858 GMT+02:00] Env: PATH_INFO=/loginsfgsd
[23/06/1999 17:30:35:859 GMT+02:00] Will read 53 bytes for this line
[23/06/1999 17:30:35:860 GMT+02:00] Read: EPATH_TRANSLATED	/web/192.168.255.3/htdocs/loginsfgsd
[23/06/1999 17:30:35:862 GMT+02:00] Env: PATH_TRANSLATED=/web/192.168.255.3/htdocs/loginsfgsd
[23/06/1999 17:30:35:863 GMT+02:00] Will read 14 bytes for this line
[23/06/1999 17:30:35:865 GMT+02:00] Read: EQUERY_STRING	
[23/06/1999 17:30:35:866 GMT+02:00] Env: QUERY_STRING=null
[23/06/1999 17:30:35:867 GMT+02:00] Will read 26 bytes for this line
[23/06/1999 17:30:35:869 GMT+02:00] Read: EREMOTE_ADDR	192.168.0.104
[23/06/1999 17:30:35:869 GMT+02:00] Env: REMOTE_ADDR=192.168.0.104
[23/06/1999 17:30:35:869 GMT+02:00] Will read 17 bytes for this line
[23/06/1999 17:30:35:869 GMT+02:00] Read: EREMOTE_PORT	1444
[23/06/1999 17:30:35:869 GMT+02:00] Env: REMOTE_PORT=1444
[23/06/1999 17:30:35:869 GMT+02:00] Will read 19 bytes for this line
[23/06/1999 17:30:35:869 GMT+02:00] Read: EREQUEST_METHOD	GET
[23/06/1999 17:30:35:870 GMT+02:00] Env: REQUEST_METHOD=GET
[23/06/1999 17:30:35:870 GMT+02:00] Will read 41 bytes for this line
[23/06/1999 17:30:35:870 GMT+02:00] Read: EREQUEST_URI	/timesheet/tsheet/loginsfgsd
[23/06/1999 17:30:35:870 GMT+02:00] Env: REQUEST_URI=/timesheet/tsheet/loginsfgsd
[23/06/1999 17:30:35:870 GMT+02:00] Will read 34 bytes for this line
[23/06/1999 17:30:35:870 GMT+02:00] Read: ESCRIPT_FILENAME	/timesheet/tsheet
[23/06/1999 17:30:35:870 GMT+02:00] Env: SCRIPT_FILENAME=/timesheet/tsheet
[23/06/1999 17:30:35:870 GMT+02:00] Will read 30 bytes for this line
[23/06/1999 17:30:35:871 GMT+02:00] Read: ESCRIPT_NAME	/timesheet/tsheet
[23/06/1999 17:30:35:871 GMT+02:00] Env: SCRIPT_NAME=/timesheet/tsheet
[23/06/1999 17:30:35:871 GMT+02:00] Will read 43 bytes for this line
[23/06/1999 17:30:35:871 GMT+02:00] Read: ESERVER_ADMIN	michael.roeschter@dynaware.de
[23/06/1999 17:30:35:871 GMT+02:00] Env: SERVER_ADMIN=michael.roeschter@dynaware.de
[23/06/1999 17:30:35:871 GMT+02:00] Will read 26 bytes for this line
[23/06/1999 17:30:35:871 GMT+02:00] Read: ESERVER_NAME	192.168.255.3
[23/06/1999 17:30:35:871 GMT+02:00] Env: SERVER_NAME=192.168.255.3
[23/06/1999 17:30:35:871 GMT+02:00] Will read 15 bytes for this line
[23/06/1999 17:30:35:872 GMT+02:00] Read: ESERVER_PORT	80
[23/06/1999 17:30:35:872 GMT+02:00] Env: SERVER_PORT=80
[23/06/1999 17:30:35:872 GMT+02:00] Will read 25 bytes for this line
[23/06/1999 17:30:35:872 GMT+02:00] Read: ESERVER_PROTOCOL	HTTP/1.0
[23/06/1999 17:30:35:872 GMT+02:00] Env: SERVER_PROTOCOL=HTTP/1.0
[23/06/1999 17:30:35:872 GMT+02:00] Will read 82 bytes for this line
[23/06/1999 17:30:35:872 GMT+02:00] Read: ESERVER_SIGNATURE	<ADDRESS>Apache/1.3.6 Server
at 192.168.255.3 Port 80</ADDRESS>

[23/06/1999 17:30:35:873 GMT+02:00] Env: SERVER_SIGNATURE=<ADDRESS>Apache/1.3.6 Server
at 192.168.255.3 Port 80</ADDRESS>

[23/06/1999 17:30:35:873 GMT+02:00] Will read 81 bytes for this line
[23/06/1999 17:30:35:873 GMT+02:00] Read: ESERVER_SOFTWARE	Apache/1.3.6 (Unix) ApacheJServ/1.0
mod_ssl/2.3.3 OpenSSL/0.9.3a
[23/06/1999 17:30:35:873 GMT+02:00] Env: SERVER_SOFTWARE=Apache/1.3.6 (Unix) ApacheJServ/1.0
mod_ssl/2.3.3 OpenSSL/0.9.3a
[23/06/1999 17:30:35:873 GMT+02:00] Will read 75 bytes for this line
[23/06/1999 17:30:35:873 GMT+02:00] Read: HAccept	image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, image/png, */*
[23/06/1999 17:30:35:874 GMT+02:00] Header: Accept=image/gif, image/x-xbitmap, image/jpeg,
image/pjpeg, image/png, */*
[23/06/1999 17:30:35:874 GMT+02:00] Will read 34 bytes for this line
[23/06/1999 17:30:35:874 GMT+02:00] Read: HAccept-Charset	iso-8859-1,*,utf-8
[23/06/1999 17:30:35:874 GMT+02:00] Header: Accept-Charset=iso-8859-1,*,utf-8
[23/06/1999 17:30:35:874 GMT+02:00] Will read 21 bytes for this line
[23/06/1999 17:30:35:874 GMT+02:00] Read: HAccept-Encoding	gzip
[23/06/1999 17:30:35:874 GMT+02:00] Header: Accept-Encoding=gzip
[23/06/1999 17:30:35:874 GMT+02:00] Will read 19 bytes for this line
[23/06/1999 17:30:35:874 GMT+02:00] Read: HAccept-Language	en
[23/06/1999 17:30:35:875 GMT+02:00] Header: Accept-Language=en
[23/06/1999 17:30:35:875 GMT+02:00] Will read 22 bytes for this line
[23/06/1999 17:30:35:875 GMT+02:00] Read: HConnection	Keep-Alive
[23/06/1999 17:30:35:875 GMT+02:00] Header: Connection=Keep-Alive
[23/06/1999 17:30:35:875 GMT+02:00] Will read 54 bytes for this line
[23/06/1999 17:30:35:875 GMT+02:00] Read: HCookie	JServSessionId=3fca2182002aa4f8.1.930120401328
[23/06/1999 17:30:35:875 GMT+02:00] Header: Cookie=JServSessionId=3fca2182002aa4f8.1.930120401328
[23/06/1999 17:30:35:876 GMT+02:00] Will read 19 bytes for this line
[23/06/1999 17:30:35:876 GMT+02:00] Read: HHost	192.168.255.3
[23/06/1999 17:30:35:876 GMT+02:00] Header: Host=192.168.255.3
[23/06/1999 17:30:35:876 GMT+02:00] Will read 61 bytes for this line
[23/06/1999 17:30:35:876 GMT+02:00] Read: HIf-Modified-Since	Wed, 23 Jun 1999 15:30:33 GMT;
length=7547
[23/06/1999 17:30:35:876 GMT+02:00] Header: If-Modified-Since=Wed, 23 Jun 1999 15:30:33 GMT;
length=7547
[23/06/1999 17:30:35:876 GMT+02:00] Will read 16 bytes for this line
[23/06/1999 17:30:35:876 GMT+02:00] Read: HPragma	no-cache
[23/06/1999 17:30:35:877 GMT+02:00] Header: Pragma=no-cache
[23/06/1999 17:30:35:877 GMT+02:00] Will read 39 bytes for this line
[23/06/1999 17:30:35:877 GMT+02:00] Read: HUser-Agent	Mozilla/4.5 [en] (WinNT; I)
[23/06/1999 17:30:35:877 GMT+02:00] Header: User-Agent=Mozilla/4.5 [en] (WinNT; I)
[23/06/1999 17:30:35:877 GMT+02:00] All data read.
[23/06/1999 17:30:35:877 GMT+02:00] Parsing cookies
[23/06/1999 17:30:35:878 GMT+02:00] Request is in session 3fca2182002aa4f8.1.930120401328
[23/06/1999 17:30:35:878 GMT+02:00] Calling service()
[23/06/1999 17:30:35:880 GMT+02:00] Sending response headers.
[23/06/1999 17:30:35:880 GMT+02:00] Status: 500 Internal Server Error
[23/06/1999 17:30:35:881 GMT+02:00] Servlet-Error: java.lang.IllegalArgumentException: Wed,
23 Jun 1999 15:30:33 GMT; length=7547 : Wed, 23 Jun 1999 15:30:33 GMT; length=7547 
[23/06/1999 17:30:35:958 GMT+02:00] java.lang.IllegalArgumentException: Wed, 23 Jun 1999 15:30:33
GMT; length=7547 
	at org.apache.jserv.JServConnection.getDateHeader(JServConnection.java:1259)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:493)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
	at org.apache.jserv.JServConnection.run(JServConnection.java:359)
	at java.lang.Thread.run(Thread.java:479)
>How-To-Repeat:
1. Set a date-modified header field in the response with a date well in the past
 HttpServletRepsonse.setDateField( "date-modified", new Date().getTime()-100000000 )

2. Now the browser believes the page is cacheable (what is intended)
3. Re- requesting the page will do nothing because the browser looks in the cache

4. Press the "reload" button on your browser

5. The http Header sent will now contain a line:
  If-Modified-Since: Wed, 23 Jun 1999 15:30:33 GMT; length=7547

6. This again results in the ( perfectly predictable ) exception
 java.lang.IllegalArgumentException: Wed, 23 Jun 1999 15:30:33 GMT; length=7547 
        at org.apache.jserv.JServConnection.getDateHeader(JServConnection.java:1259)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:493)
	at javax.servlet.http.HttpServlet.service(HttpServlet.java:588)
        at org.apache.jserv.JServConnection.run(JServConnection.java:359)
	at java.lang.Thread.run(Thread.java:479)

>Fix:

Be more lenient when parsing the dates by taking only the first argument of
a header field which is expected to contain dates.
>Audit-Trail:
>Unformatted:
[In order for any reply to be added to the PR database, you need]
[to include <apbugs@Apache.Org> in the Cc line and make sure the]
[subject line starts with the report component and number, with ]
[or without any 'Re:' prefixes (such as "general/1098:" or      ]
["Re: general/1098:").  If the subject doesn't match this       ]
[pattern, your message will be misfiled and ignored.  The       ]
["apbugs" address is not added to the Cc line of messages from  ]
[the database automatically because of the potential for mail   ]
[loops.  If you do not include this Cc, your reply may be ig-   ]
[nored unless you are responding to an explicit request from a  ]
[developer.  Reply only with text; DO NOT SEND ATTACHMENTS!     ]




Mime
View raw message