Skip to content

Commit

Permalink
feat: add common fns for audit message
Browse files Browse the repository at this point in the history
  • Loading branch information
Chinlinlee committed Aug 27, 2023
1 parent 8bbe7bd commit 8e7d171
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions api/dicom-web/service/dicom-web.service.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,26 @@ class DicomWebService {
return basicUrlObj.href;
}

/**
*
* @param {import('http').IncomingMessage} request
* @returns
*/
static getRemoteAddress(request) {
return _.get(request, "socket.remoteAddress", "127.0.0.1");
}

static getRemoteHostname(request) {
return request.headers.host.split(':')[0];
}

static getServerAddress() {
return `${raccoonConfig.serverConfig.host}:${raccoonConfig.serverConfig.port}`;
}

static getServerHostname() {
return `${raccoonConfig.serverConfig.host}`;
}
}

module.exports.DicomWebService = DicomWebService;

0 comments on commit 8e7d171

Please sign in to comment.