Closed Bug 1503760 Opened 5 years ago Closed 5 years ago doesn't return 0 byte downloads


(WebExtensions :: General, defect, P5)

63 Branch


(firefox65 verified, firefox66 verified)

Tracking Status
firefox65 --- verified
firefox66 --- verified


(Reporter: jwensley2, Assigned: ben.armstrong22, Mentored)



(Keywords: good-first-bug)


(2 files)

User Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:63.0) Gecko/20100101 Firefox/63.0

Steps to reproduce:

I generated a 0 byte file using the following code

header('Content-Description: File Transfer');
header('Content-Type: application/octet-stream');
header('Content-Disposition: attachment; filename="test.bin"');
header('Content-Transfer-Encoding: binary');
header('Content-Length: ' . 0);

And then tried to query for the download using{})

Actual results:

No results were returned

Expected results:

The download should have been returned
Does this actually get created on the filesystem and is it shown in the download section of the library?
Flags: needinfo?(jwensley2)
(In reply to David Durst [:ddurst] (Regression Engineering Owner for 63) from comment #1)
> Does this actually get created on the filesystem and is it shown in the
> download section of the library?

Yes, the files are created on the filesystem and they show up in the library.
Flags: needinfo?(jwensley2)
The issue is here:

If the totalBytesGreater query property isn't specified we default to 0 which means search() only returns those with a size > 0.  Changing the default there to -1 should fix this.  It could also use a test.
Mentor: aswan
Keywords: good-first-bug
Priority: -- → P5
If this is your first contribution, please see for information on getting started.
Hi, I'll be taking a look at trying to fix this, thanks.
Welcome, Ben! If you need any help, please needinfo :aswan, the bug mentor. 

Happy bug fixing!
Assignee: nobody → ben.armstrong22
Ever confirmed: true
Hi Andrew,

To test this where do I execute the code Joseph Wensley provided to reproduce?

Flags: needinfo?(aswan)
I don't think you need to use his specific code, just making a 0 byte file available via http (either by putting it on the filesystem where an http server can read it or by writing your own handler for your web server framework of choice) is fine.
Flags: needinfo?(aswan)
Updated the totalBytesGreater property in{}) to default to -1 so files with a byte size of 0 will be returned.
Keywords: checkin-needed
Pushed by
Changed{}) to return 0 byte downloads. r=aswan
Keywords: checkin-needed
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla65
Attached file
I was able to reproduce this issue on Firefox 63.0.3(20181114214635) under Win 7 64-bit and  Mac OS X 10.13.6.

This issue is verified as fixed on Firefox 66.0a1(20181211093801) and 65.0b3(20181210164452) under Win 7 64-bit and Mac OS X 10.13.6.

I used: and Xampp for testing.

Please see the attached screenshots.
Depends on: 1519762
You need to log in before you can comment on or make changes to this bug.