From 022fe404df82d8f98b6ee99acaf9ed5a5263f370 Mon Sep 17 00:00:00 2001 From: Rudolph Gottesheim Date: Mon, 4 Sep 2017 12:23:28 +0200 Subject: [PATCH] Add property "authorization" to the MetaConfig interface This property isn't properly documented (https://github.com/systemjs/systemjs/blob/master/docs/config-api.md#meta), but the implementation can be found here: * https://github.com/systemjs/systemjs/blob/96f9ec1edf9507491b981044f68d30672f199fb8/src/fetch.js#L26 * https://github.com/systemjs/systemjs/blob/96f9ec1edf9507491b981044f68d30672f199fb8/src/fetch.js#L83 --- types/systemjs/index.d.ts | 6 ++++++ types/systemjs/systemjs-tests.ts | 16 ++++++++++++++++ 2 files changed, 22 insertions(+) diff --git a/types/systemjs/index.d.ts b/types/systemjs/index.d.ts index a896c3ca7d..8f230e7c09 100644 --- a/types/systemjs/index.d.ts +++ b/types/systemjs/index.d.ts @@ -111,6 +111,12 @@ declare namespace SystemJSLoader { * Use with the SystemJS Builder. (https://github.com/systemjs/builder#ignore-resources) */ build?: boolean; + + /** + * A truthy value enables sending credentials to the server on every request. Additionally, a string value adds + * an "Authorization" header with that value to all requests. + */ + authorization?: string | boolean; } interface PackageConfig { diff --git a/types/systemjs/systemjs-tests.ts b/types/systemjs/systemjs-tests.ts index fa0ddbedaf..eb663a1e2c 100644 --- a/types/systemjs/systemjs-tests.ts +++ b/types/systemjs/systemjs-tests.ts @@ -22,6 +22,22 @@ SystemJS.config({ } }); +SystemJS.config({ + meta: { + '*': { + authorization: true + } + } +}); + +SystemJS.config({ + meta: { + '*': { + authorization: 'Basic YWxhZGRpbjpvcGVuc2VzYW1l' + } + } +}); + SystemJS.config({ map: { 'local/package': {