mirror of
https://github.com/nasa/openmct.git
synced 2025-01-19 03:06:54 +00:00
Merge pull request #1159 from raoulsullivan/squashed_proxy_parameters
[proxyUrl] pass URL parameters to proxied URL
This commit is contained in:
commit
68adea7b5a
10
app.js
10
app.js
@ -67,10 +67,14 @@
|
||||
});
|
||||
|
||||
app.use('/proxyUrl', function proxyRequest(req, res, next) {
|
||||
console.log('Proxying request to: ', req.query.url);
|
||||
var targetUrl = req.query.url;
|
||||
var queryParameters = req.query;
|
||||
console.log('Proxying request to: ', targetUrl);
|
||||
delete queryParameters['url'];
|
||||
req.pipe(request({
|
||||
url: req.query.url,
|
||||
strictSSL: false
|
||||
url: targetUrl,
|
||||
strictSSL: false,
|
||||
qs: queryParameters
|
||||
}).on('error', next)).pipe(res);
|
||||
});
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user