ufairiya / mongoose

Automatically exported from code.google.com/p/mongoose
MIT License
0 stars 0 forks source link

If-Modified-Since request header not working #133

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Build an application embedding latest mongoose.c.
2. Open a browser and request a static file.
3.

What is the expected output? What do you see instead?
The server should only send the 200 OK response one time, then future
requests should present the 304 Not Modified response.

What version of the product are you using? On what operating system?
Latest code from google - svn, Windows Vista.

Please provide any additional information below.
The fix is to change the following line in the is_not_modified function:

    return (ims != NULL && stp->mtime < date_to_epoch(ims));
     ... needs to change to ....
    return (ims != NULL && stp->mtime <= date_to_epoch(ims));

The = condition indicates that the file has not changed as well as the <
condition.

Thanks!

Original issue reported on code.google.com by csgrim...@gmail.com on 1 Apr 2010 at 4:45

GoogleCodeExporter commented 9 years ago
Submitted http://code.google.com/p/mongoose/source/detail?r=496
Thank you!

Original comment by valenok on 21 Apr 2010 at 11:40