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

Side by Side Diff: third_party/WebKit/LayoutTests/http/tests/fetch/resources/useragent-header.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
(Empty)
1 function parse_response(body) {
2 const lines = body.split('\n');
3 for (let line of lines) {
4 if (line.length == 0) {
5 continue;
6 }
7 const parts = line.split(': ', 2);
8 if (parts.length < 2) {
9 return 'ERROR: Invalid line in response: ' + line;
10 }
11 if (parts[0] == 'HTTP_USER_AGENT') {
12 return parts[1];
13 }
14 }
15 return 'ERROR: User-Agent header not found';
16 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698