New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 680965 link

Starred by 1 user

Issue metadata

Status: WontFix
Owner: ----
Closed: Jan 2017
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

The DOM Response `statusText` won't accept none latin characters

Reported by jarro...@gmail.com, Jan 13 2017

Issue description

UserAgent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/57.0.2970.0 Safari/537.36

Steps to reproduce the problem:
Create response object as follows:

new Response('test', {status: 403, statusText: 'В доступе отказано'});

What is the expected behavior?
Should create a Response object

What went wrong?
Throws TypeError: Failed to construct 'Response': Invalid statusText

Did this work before? N/A 

Chrome version: 57.0.2970.0  Channel: dev
OS Version: 
Flash Version: Shockwave Flash 24.0 r0

The issue was reported by one of my users. My app uses the Fetch API in (still) Chrome application. His server returns "403 В доступе отказано" status and my app generates an error when constructing the response.

The only TypeError related to this case I found in the spec is this:

If init’s statusText member does not match the reason-phrase token production, then throw a TypeError.

The reason-phrase is the status text part of the HTTP status line. I'm not sure how this affecting this. If I change status test from this example to anything else that contains latin characters only it works well.
 
Components: -Blink Blink>Network>FetchAPI

Comment 2 by ajha@chromium.org, Jan 16 2017

Labels: Needs-Triage-M57

Comment 3 by hdodda@chromium.org, Jan 17 2017

Cc: hdodda@chromium.org
Labels: -Needs-Triage-M57 M-57 OS-Mac OS-Windows
Status: Untriaged (was: Unconfirmed)
Tested on windows 7 , ubuntu 14.04 and mac os 10.12.2 using chrome canary M57 #57.0.2984.0 and issue is reproduced.

Issue is seen from M30 #30.0.1549.0 and is a non-regression issue ,

Marking it as untraiged.

Thanks!
On Firefox:

>> new Response('', {statusText: '大学院'})
TypeError: Cannot convert string to ByteString because the character at index 0 has value 22823 which is greater than 255.

Comment 5 by ricea@chromium.org, Jan 20 2017

Status: WontFix (was: Untriaged)
According to https://heycam.github.io/webidl/#es-ByteString Firefox's behaviour is correct.

The statusText is treated as a string of bytes, not characters. If you want to put UTF-8 in there, you need to encode the UTF-8 to bytes using TextEncoder and then put those bytes in a string.

Closing as Working As Intended.

Sign in to add a comment