Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Delta Between Two Patch Sets: assets/js/XMLHttpRequest.jsm

Issue 8482109: ABP/Android JavaScript code (Closed)
Left Patch Set: Created Oct. 5, 2012, 9:23 a.m.
Right Patch Set: ABP/Android JavaScript code Created Nov. 13, 2012, 9:44 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « assets/js/Synchronizer.jsm ('k') | assets/js/basedomain.js » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
1 1
2 XMLHttpRequest = function() 2 XMLHttpRequest = function()
3 { 3 {
4 this.headers = {}; 4 this.headers = {};
5 this.responseHeaders = {}; 5 this.responseHeaders = {};
6 }; 6 };
7 7
8 XMLHttpRequest.UNSENT = 0; 8 XMLHttpRequest.UNSENT = 0;
9 XMLHttpRequest.OPEN = 1; 9 XMLHttpRequest.OPEN = 1;
10 XMLHttpRequest.HEADERS_RECEIVED = 2; 10 XMLHttpRequest.HEADERS_RECEIVED = 2;
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 this.readyState = XMLHttpRequest.DONE; 68 this.readyState = XMLHttpRequest.DONE;
69 this.onreadystatechange(); 69 this.onreadystatechange();
70 }, 70 },
71 onreadystatechange: function(){}, 71 onreadystatechange: function(){},
72 getResponseHeader: function(header) 72 getResponseHeader: function(header)
73 { 73 {
74 if (this.readyState < XMLHttpRequest.LOADING) 74 if (this.readyState < XMLHttpRequest.LOADING)
75 throw new Error("INVALID_STATE_ERR"); 75 throw new Error("INVALID_STATE_ERR");
76 else 76 else
77 { 77 {
78 var lcHeader = header.toLowerCase();
78 var returnedHeaders = []; 79 var returnedHeaders = [];
79 for (var rHeader in this.responseHeaders) 80 for (var rHeader in this.responseHeaders)
80 { 81 {
81 if (rHeader.match(new RegExp(header, "i"))) 82 if (this.responseHeaders.hasOwnProperty(rHeader) && rHeader.toLowerCase( ) == lcHeader)
Felix Dahlke 2012/11/09 14:59:16 I think we need to quote the header to use it in a
Andrey Novikov 2012/11/12 09:33:12 Done.
82 returnedHeaders.push(this.responseHeaders[rHeader]); 83 returnedHeaders.push(this.responseHeaders[rHeader]);
83 } 84 }
84 85
85 if (returnedHeaders.length) 86 if (returnedHeaders.length)
86 return returnedHeaders.join(", "); 87 return returnedHeaders.join(", ");
87 } 88 }
88 89
89 return null; 90 return null;
90 }, 91 },
91 getAllResponseHeaders: function(header) 92 getAllResponseHeaders: function(header)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 status: -1, 161 status: -1,
161 notificationCallbacks: {}, 162 notificationCallbacks: {},
162 loadFlags: 0, 163 loadFlags: 0,
163 INHIBIT_CACHING: 0, 164 INHIBIT_CACHING: 0,
164 VALIDATE_ALWAYS: 0, 165 VALIDATE_ALWAYS: 0,
165 QueryInterface: function() 166 QueryInterface: function()
166 { 167 {
167 return this; 168 return this;
168 } 169 }
169 }; 170 };
LEFTRIGHT

Powered by Google App Engine
This is Rietveld