Bug 138365
| Summary: | Safari gets stuck loading media files when Apache authentication is enabled | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | weydson |
| Component: | Media | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bugs.webkit.org |
| Priority: | P2 | ||
| Version: | 528+ (Nightly build) | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
weydson
Tested on Safari 7.0.5 on a Mac (10.9.4) and iPhone 8.0.2
When loading a mp3 file such as:
<audio controls>
<source src="assets/media.mp3" type="audio/mpeg">
Your browser does not support the audio element.
</audio>
Safari gets stuck on loading the mp3 file when Apache Basic Authentication is enabled. Once we disable authentication, the media plays fine.
It works fine on iOS 7, Firefox and Chrome.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
K S
Almost a year ago, this bug still exists in iOS. It exists on iOS 8 and 9 (and probably 9.1). It does not exist on the latest X OS (10.11.1), but there the situation still displays very weird behavior. Webkit makes *4* requests for *1* mp3 file.
Note the change from AppleWebKit user-agent to AppleCoreMedia. The same happens with Safari in ipad for non-protected media. So, there are always at least two requests for an mp3 file where there should only be one. But at least they don't fail.
Safari on iOS:
First request for page:
<> - username [23/Oct/2015:16:35:01 +0200] "GET / HTTP/1.1" 200 3990 "-" "Mozilla/5.0 (iPad; CPU OS 9_0_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A452 Safari/601.1"
next request for mp3:
<> - - [23/Oct/2015:16:35:01 +0200] "GET /audio/effects/click.mp3 HTTP/1.1" 401 3609 "https://whatever.example.com/" "Mozilla/5.0 (iPad; CPU OS 9_0_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A452 Safari/601.1"
and with this 401 it fails silently. Instead, it should use the username already cached for this ressource and if that fails ask for the credentials instead of failing silently.
Working request (no auth):
<> - - [23/Oct/2015:16:40:10 +0200] "GET /content/audio/fr/a995006.mp3 HTTP/1.1" 200 6342 "https://whatever.example.com/" "Mozilla/5.0 (iPad; CPU OS 9_0_2 like Mac OS X) AppleWebKit/601.1.46 (KHTML, like Gecko) Version/9.0 Mobile/13A452 Safari/601.1"
<> - - [23/Oct/2015:16:40:10 +0200] "GET /content/audio/fr/a995006.mp3 HTTP/1.1" 200 6342 "https://whatever.example.com/" "AppleCoreMedia/1.0.0.13A452 (iPad; U; CPU OS 9_0_2 like Mac OS X; de_de)"
Safari on Mac:
First request by AppleWebKit, gets a 401 (instead of using the known credentials!)
<> - - [23/Oct/2015:16:15:26 +0200] "GET /content/audio/ar/a995002.mp3 HTTP/1.1" 401 966 "https://whatever.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
Second request by AppleWebKit, with credentials:
<> - username [23/Oct/2015:16:15:27 +0200] "GET /content/audio/ar/a995002.mp3 HTTP/1.1" 200 6735 "https://whatever.example.com/" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_1) AppleWebKit/601.2.7 (KHTML, like Gecko) Version/9.0.1 Safari/601.2.7"
Erfolg! Wieso versucht er's nochmal?:
Third reuest, now by AppleCoreMedia, again without credentials:
<> - - [23/Oct/2015:16:15:27 +0200] "GET /content/audio/ar/a995002.mp3 HTTP/1.1" 401 966 "https://whatever.example.com/" "AppleCoreMedia/1.0.0.15B42 (Macintosh; U; Intel Mac OS X 10_11_1; de_de)"
Third request, again by AppleCoreMedia, finally with credentials:
<> - username [23/Oct/2015:16:15:27 +0200] "GET /content/audio/ar/a995002.mp3 HTTP/1.1" 200 6735 "https://whatever.example.com/" "AppleCoreMedia/1.0.0.15B42 (Macintosh; U; Intel Mac OS X 10_11_1; de_de)"
Four requests where there should have been one!