Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download link sends Last-Modified: Thu, 01 Jan 1970 00:00:00 GMT HTTP header #51

Open
8u opened this issue May 5, 2020 · 2 comments
Open
Labels

Comments

@8u
Copy link

8u commented May 5, 2020

How to reproduce:
wget --server-response https://browscap.org/stream?q=PHP_BrowsCapINI

This header makes HTTP agents to save the file with the 1970 modified time:
image

Workaround until fixed: use --no-use-server-timestamps parameter of wget

@asgrim asgrim transferred this issue from browscap/browscap May 5, 2020
@asgrim
Copy link
Member

asgrim commented May 5, 2020

return (new Response())
->withHeader('Content-Disposition', 'attachment;filename="' . $file . '"')
->withHeader('Last-Modified', $this->metadata->released()->format('D, d M Y H:i:s'))
->withHeader('ETag', sha1($this->metadata->version() . $browscapVersion))
->withHeader('Cache-Control', 'max-age=86400 s-max-age=86400')
->withBody(new Stream($fileHandle));

@asgrim asgrim added bug and removed enhancement labels May 5, 2020
@asgrim
Copy link
Member

asgrim commented May 5, 2020

  1. check StreamHandler is getting the correct metadata value, and is returning it appropriately
  2. check if CloudFlare messes with this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants