1 line
372 KiB
Plaintext
1 line
372 KiB
Plaintext
|
|
{"version":3,"file":"_module-chunk.mjs","sources":["../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/headers.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/context.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/params.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/request.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/response.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/fetch.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/xhr.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/interceptor.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/backend.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/client.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/jsonp.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/xsrf.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/provider.ts","../../../../../k8-fastbuild-ST-fdfa778d11ba/bin/packages/common/http/src/module.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\n *\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://angular.dev/license\n */\n\ninterface Update {\n name: string;\n value?: string | string[];\n op: 'a' | 's' | 'd';\n}\n\n/**\n * Represents the header configuration options for an HTTP request.\n * Instances are immutable. Modifying methods return a cloned\n * instance with the change. The original object is never changed.\n *\n * @see [Setting request headers](guide/http/making-requests#setting-request-headers)\n *\n * @publicApi\n */\nexport class HttpHeaders {\n /**\n * Internal map of lowercase header names to values.\n */\n private headers!: Map<string, string[]>;\n\n /**\n * Internal map of lowercased header names to the normalized\n * form of the name (the form seen first).\n */\n private normalizedNames: Map<string, string> = new Map();\n\n /**\n * Complete the lazy initialization of this object (needed before reading).\n */\n private lazyInit!: HttpHeaders | Function | null;\n\n /**\n * Queued updates to be materialized the next initialization.\n */\n private lazyUpdate: Update[] | null = null;\n\n /** Constructs a new HTTP header object with the given values.*/\n\n constructor(\n headers?: string | {[name: string]: string | number | (string | number)[]} | Headers,\n ) {\n if (!headers) {\n this.headers = new Map<string, string[]>();\n } else if (typeof headers === 'string') {\n this.lazyInit = () => {\n this.headers = new Map<string, string[]>();\n headers.split('\\n').forEach((line) => {\n const index = line.indexOf(':');\n if (index > 0) {\n const name = line.slice(0, index);\n const value = line.slice(index + 1).trim();\n this.addHeaderEntry(name, value);\n }\n });\n };\n } else if (typeof Headers !== 'undefined' && headers instanceof Headers) {\n this.headers = new Map<string, string[]>();\n headers.forEach((value: string, name: string) => {\n this.addHeaderEntry(name, value);\n });\n } else {\n this.lazyInit = () => {\n if (typeof ngDevMode === 'undefined' || ngDevMode) {\n assertValidHeaders(headers);\n }\n this.headers = new Map<string, string[]>();\n Object.entries(headers).forEach(([name, values]) => {\n this.setHeaderEntries(name, values);\n });\n };\n }\n }\n\n /**\n * Checks for existence of a given header.\n *\n * @param name The header name to check for existence.\n *\n * @returns True if the header exists, false otherwise.\n */\n has(name: string): boolean {\n this.init();\n\n return this.headers.has(name.toLowerCase());\n
|