webRequest API gives empty header value when it includes non-ASCII character

UNCONFIRMED
Unassigned

Status

()

Toolkit
WebExtensions: Request Handling
P3
normal
UNCONFIRMED
a month ago
a month ago

People

(Reporter: jingyu9575, Unassigned)

Tracking

unspecified
Points:
---

Firefox Tracking Flags

(firefox57 wontfix)

Details

(Reporter)

Description

a month ago
User Agent: Mozilla/5.0 (X11; Linux x86_64; rv:57.0) Gecko/20100101 Firefox/57.0
Build ID: 20170911100210

Steps to reproduce:

Latest Nightly 57.0a1 20170911100210. (20170907100318 does not have this bug.)

1. Create a test extension:

manifest.json:

    {
      "manifest_version": 2,
      "name": "test",
      "version": "1.1",
      "permissions": [
        "webRequest", "webRequestBlocking", "<all_urls>" 
      ],  
      "background": {
        "scripts": ["background.js"]
      }
    }

background.js:

    browser.webRequest.onHeadersReceived.addListener(e => {
      for (const h of e.responseHeaders)
        console.log(h)
    }, { urls: ["<all_urls>"] }, ["blocking", "responseHeaders"])

2. load this extension in about:debugging and debug it.
3. Open the page's F12 developer tool, Network tab. Then navigate to http://www.beian.gov.cn/portal/downloadFile?id=29  . This url gives a non-ASCII Content-Disposition header. 





Actual results:

After cancelling the download, the F12 developer tool shows that the Content-Disposition header has value.

However, the extension debug log shows:

Object { name: "Content-Disposition", value: "" }
Object { name: "Content-Type", value: "multipart/form-data;charset=UTF-8" }
......


Expected results:

This header object should have non-empty value or binaryValue, as shown in F12 developer tool.
(Reporter)

Updated

a month ago
Component: Untriaged → WebExtensions: Request Handling
Product: Firefox → Toolkit

Updated

a month ago
status-firefox57: --- → wontfix
Priority: -- → P3
You need to log in before you can comment on or make changes to this bug.