Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(18)

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/inspector/service-workers/resources/user-agent-override-worker.js

Issue 2254693002: Delay generation of User-Agent header to URLRequestHttpJob and accept custom User-Agent from XHR/Fe… Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changed Android test Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 function dumpUserAgent() 1 function dumpUserAgent()
2 { 2 {
3 fetch('http://127.0.0.1:8000/inspector/resources/echo-headers.php') 3 fetch('http://127.0.0.1:8000/resources/echo-headers.php')
4 .then(function(response) { 4 .then(function(response) {
5 return response.text(); 5 return response.text();
6 }).then(function(body) { 6 }).then(function(body) {
7 var userAgentLine = /HTTP_USER_AGENT:.*/.exec(body)[0]; 7 var userAgentLine = /HTTP_USER_AGENT:.*/.exec(body)[0];
8 console.log(userAgentLine); 8 console.log(userAgentLine);
9 }).catch(function(err) { 9 }).catch(function(err) {
10 console.log('fetch failed: ' + err.message); 10 console.log('fetch failed: ' + err.message);
11 }); 11 });
12 } 12 }
13 13
14 self.onmessage = function(event) { 14 self.onmessage = function(event) {
15 dumpUserAgent(); 15 dumpUserAgent();
16 }; 16 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698