feat(WADOProxy): Adding proxy to POST method (#207)

This commit is contained in:
Gustavo André Lelis 2018-06-18 13:01:10 -03:00 committed by Erik Ziegler
parent ebb53db4ad
commit 1643e9f7d6

View File

@ -27,9 +27,7 @@ const authenticateUser = request => {
}); });
}; };
// Setup a Route using Iron Router to avoid Cross-origin resource sharing const handleRequest = function() {
// (CORS) errors. We only handle this route on the Server.
Router.route(Settings.uri.replace(OHIF.utils.absoluteUrl(), ''), function() {
const request = this.request; const request = this.request;
const response = this.response; const response = this.response;
const params = this.params; const params = this.params;
@ -167,6 +165,8 @@ Router.route(Settings.uri.replace(OHIF.utils.absoluteUrl(), ''), function() {
// Stream the original request information into the request // Stream the original request information into the request
// to the PACS // to the PACS
request.pipe(proxyRequest); request.pipe(proxyRequest);
}, { }
where: 'server'
}); // Setup a Route using Iron Router to avoid Cross-origin resource sharing
// (CORS) errors. We only handle this route on the Server.
Router.route(Settings.uri.replace(OHIF.utils.absoluteUrl(), ''), handleRequest, { where: 'server' });