Created
December 22, 2016 21:59
-
-
Save rhelmer/53c414b7b22e967b1f1789266cbdcab9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /* This Source Code Form is subject to the terms of the Mozilla Public | |
| * License, v. 2.0. If a copy of the MPL was not distributed with this | |
| * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ | |
| "use strict"; | |
| const { classes: Cc, interfaces: Ci, results: Cr, utils: Cu } = Components; | |
| Cu.importGlobalProperties(["XMLHttpRequest"]); | |
| this.EXPORTED_SYMBOLS = [ "ServiceRequest" ]; | |
| class ServiceRequest { | |
| constructor() { | |
| this.request = new XMLHttpRequest(); | |
| return this.request; | |
| } | |
| open(method, url, isAsync, user, password) { | |
| this.request.open(method, url, isAsync, user, password); | |
| // Disable cutting edge features, like TLS 1.3, where middleboxes might brick us | |
| this.request.channel.QueryInterface(Ci.nsIHttpChannelInternal).beConservative = true; | |
| } | |
| } | |
| this.ServiceRequest = new ServiceRequest(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment