New issue
Advanced search Search tips

Issue 689731 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: Feb 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 3
Type: Bug

Blocking:
issue 690131



Sign in to add a comment

Attribute names in MIME types are not case-insensitive

Project Member Reported by jrumm...@chromium.org, Feb 7 2017

Issue description

In fixing  issue 605661  for EME (require codecs attribute for media MIME types), I've discovered that ParsedContentType does not treat attribute names as case-insensitive. Calling parameterValueForName("codecs") on:
    'video/webm; codecs="vp8"' returns "vp8"
    'video/webm; Codecs="vp8"' returns ""
    'video/webm; CODECS="vp8"' returns ""
This is found in one of the EME layout tests [1]. Currently the tests pass as Chrome allows container only MIME types.

The documentation in the code for ParsedContentType [2] states:
// parameter := attribute "=" value
//
// attribute := token
//              ; Matching of attributes
//              ; is ALWAYS case-insensitive.

Other media code uses ContentType, which is case-insensitive for attribute names.

The code should be fixed so that the comment and the code do the same thing.


[1] https://cs.chromium.org/chromium/src/third_party/WebKit/LayoutTests/media/encrypted-media/encrypted-media-requestmediakeysystemaccess.html?l=272
[2] https://cs.chromium.org/chromium/src/third_party/WebKit/Source/platform/network/ParsedContentType.cpp?l=114

 
Blocking: 690131
Owner: yhirano@chromium.org
Status: Assigned (was: Untriaged)
Components: -Blink>HTML -Blink>Network Blink>Loader
Project Member

Comment 4 by bugdroid1@chromium.org, Feb 21 2017

Project Member

Comment 7 by bugdroid1@chromium.org, Feb 23 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/55d2881ba47ca3ba4eb6fe93f08ad98613777c5f

commit 55d2881ba47ca3ba4eb6fe93f08ad98613777c5f
Author: yhirano <yhirano@chromium.org>
Date: Thu Feb 23 05:15:40 2017

ParsedContentType parameter name matching should be case insensitive

As specified in RFC (and as written in the comment), MIME parameter attribute
matching should be always case-insensitive.

BUG= 689731 

Review-Url: https://codereview.chromium.org/2708043002
Cr-Commit-Position: refs/heads/master@{#452403}

[modify] https://crrev.com/55d2881ba47ca3ba4eb6fe93f08ad98613777c5f/third_party/WebKit/Source/platform/network/ParsedContentType.cpp
[modify] https://crrev.com/55d2881ba47ca3ba4eb6fe93f08ad98613777c5f/third_party/WebKit/Source/platform/network/ParsedContentTypeTest.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment