diff options
Diffstat (limited to 'frontend/src/utils.js')
-rw-r--r-- | frontend/src/utils.js | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/frontend/src/utils.js b/frontend/src/utils.js index 8c7fe0f..fb0e5d9 100644 --- a/frontend/src/utils.js +++ b/frontend/src/utils.js @@ -111,3 +111,10 @@ export function formatSize(size) { export function randomClassName() { return Math.random().toString(36).slice(2); } + +export function getHeaderValue(request, key) { + if (request && request.headers) { + return request.headers[Object.keys(request.headers).find(k => k.toLowerCase() === key.toLowerCase())]; + } + return undefined; +} |