[Mono-bugs] [Bug 65055][Nor] New - HttpWebRequest.IfModifiedSince and timezone problems

bugzilla-daemon@bugzilla.ximian.com bugzilla-daemon@bugzilla.ximian.com
Wed, 1 Sep 2004 08:58:54 -0400 (EDT)

Please do not reply to this email- if you want to comment on the bug, go to the
URL shown below and enter your comments there.

Changed by j@bitron.ch.


--- shadow/65055	2004-09-01 08:58:54.000000000 -0400
+++ shadow/65055.tmp.29838	2004-09-01 08:58:54.000000000 -0400
@@ -0,0 +1,43 @@
+Bug#: 65055
+Product: Mono: Class Libraries
+Version: unspecified
+OS Details: paldo unstable (linux
+Status: NEW   
+Priority: Normal
+Component: System
+AssignedTo: mono-bugs@ximian.com                            
+ReportedBy: j@bitron.ch               
+QAContact: mono-bugs@ximian.com
+TargetMilestone: ---
+Summary: HttpWebRequest.IfModifiedSince and timezone problems
+Description of Problem: 
+The following code does not work as desired:
+HttpWebResponse wr = (HttpWebResponse) wc.GetResponse ();
+File.SetLastWriteTime (file, wr.LastModified);
+wc.IfModifiedSince = File.GetLastWriteTime (file);
+HttpWebResponse wr = (HttpWebResponse) wc.GetResponse ();
+Actual Results:
+It always redownloads the file even though the file hasn't changed. The
+problem is that get_IfModifiedSince returns (via MonoHttpDate) a time stamp
+in utc (which is earlier than localtime for Europeans) wheras
+set_IfModifiedSince expects a localtime as it uses ToUniversalTime()
+Expected Results:
+Only redownload when the file has really changed. I don't know whether
+IfModifiedSince should be localtime or utc according to ecma/ms but it
+should definitively be consistent.
+How often does this happen? 
+Additional Information:
+This happens using mono 1.0.1