diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-03-25 11:29:23 +0100 |
---|---|---|
committer | sonartech <sonartech@sonarsource.com> | 2019-03-29 09:44:57 +0100 |
commit | 10cb25f0f8634d392a029a54f23ebb5e48b96e36 (patch) | |
tree | 3a1a23663f240a62b4a763ac7278c2586a9b1131 /server/sonar-web/src/main/js/helpers/request.ts | |
parent | 2beaf73c2d10dcaaf3949889af53579e7d5aba13 (diff) | |
download | sonarqube-10cb25f0f8634d392a029a54f23ebb5e48b96e36.tar.gz sonarqube-10cb25f0f8634d392a029a54f23ebb5e48b96e36.zip |
Introduce new T.Dict<T> type constructor
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/request.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/request.ts | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/server/sonar-web/src/main/js/helpers/request.ts b/server/sonar-web/src/main/js/helpers/request.ts index 29d4bb7aaff..5834fafbe28 100644 --- a/server/sonar-web/src/main/js/helpers/request.ts +++ b/server/sonar-web/src/main/js/helpers/request.ts @@ -41,16 +41,14 @@ export function getCSRFTokenValue(): string { /** * Return an object containing a special http request header used to prevent CSRF attacks. */ -export function getCSRFToken(): { [x: string]: string } { +export function getCSRFToken(): T.Dict<string> { // Fetch API in Edge doesn't work with empty header, // so we ensure non-empty value const value = getCSRFTokenValue(); return value ? { [getCSRFTokenName()]: value } : {}; } -export interface RequestData { - [x: string]: any; -} +export type RequestData = T.Dict<any>; export function omitNil(obj: RequestData): RequestData { return omitBy(obj, isNil); |