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

Don't set Content-Length header if size is unknown #3412

Merged
merged 1 commit into from
May 27, 2013
Merged

Don't set Content-Length header if size is unknown #3412

merged 1 commit into from
May 27, 2013

Conversation

MTGap
Copy link
Contributor

@MTGap MTGap commented May 17, 2013

Fix for #2013

In #3392, Google storage is now returning -2 for Google Docs which have no known file size until completely downloaded.

@icewind1991

@icewind1991
Copy link
Contributor

👍

@MTGap
Copy link
Contributor Author

MTGap commented May 17, 2013

Still broken for WebDAV. Anyway to turn off setting Content-Length for those downloads?

header('Content-Type: '.\OC\Files\Filesystem::getMimeType($filename));
header("Content-Length: ".\OC\Files\Filesystem::filesize($filename));
if ($filesize > -1) {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How does sending "Content-Length: 0" make sense?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For an empty file?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see.

@tanghus
Copy link
Contributor

tanghus commented May 27, 2013

Not tested but looks good 👍 I couldn't find where to set it for WebDAV either.

MTGap pushed a commit that referenced this pull request May 27, 2013
Don't set Content-Length header if size is unknown
@MTGap MTGap merged commit 6151c0d into master May 27, 2013
@MTGap MTGap deleted the fix_2013 branch May 27, 2013 14:44
@lock lock bot locked as resolved and limited conversation to collaborators Aug 25, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants