fix(xo-server/callProxyMethod): dont use HTTP proxy

This commit is contained in:
Julien Fontanet 2020-07-06 17:05:52 +02:00
parent 60a696916b
commit 7ea50ea41e
3 changed files with 10 additions and 1 deletions

View File

@ -11,6 +11,8 @@
> Users must be able to say: “I had this issue, happy to know it's fixed”
- [Proxy] Don't use configured HTTP proxy to connect to XO proxy
### Packages to release
> Packages will be released in the order they are here, therefore, they should
@ -27,3 +29,5 @@
> - major: if the change breaks compatibility
>
> In case of conflict, the highest (lowest in previous list) `$version` wins.
- xo-server patch

View File

@ -22,6 +22,10 @@ export default class Http {
this.setHttpProxy(httpProxy)
}
// TODO: find a way to decide for which addresses the proxy should be used
//
// For the moment, use this method only to access external resources (e.g.
// patches, upgrades, support tunnel)
httpRequest(...args) {
return hrp(
{

View File

@ -1,5 +1,6 @@
import cookie from 'cookie'
import defer from 'golike-defer'
import hrp from 'http-request-plus'
import parseSetCookie from 'set-cookie-parser'
import pumpify from 'pumpify'
import split2 from 'split2'
@ -359,7 +360,7 @@ export default class Proxy {
request.host = assertProxyAddress(proxy, proxy.address)
}
const response = await this._app.httpRequest(request)
const response = await hrp(request)
const authenticationToken = parseSetCookie(response, {
map: true,