mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fix(http): Update types for TypeScript nullability support
This commit is contained in:
committed by
Tobias Bosch
parent
86396a43e9
commit
c36ec9bf60
@@ -32,14 +32,14 @@ export function normalizeMethodName(method: string | RequestMethod): RequestMeth
|
||||
|
||||
export const isSuccess = (status: number): boolean => (status >= 200 && status < 300);
|
||||
|
||||
export function getResponseURL(xhr: any): string {
|
||||
export function getResponseURL(xhr: any): string|null {
|
||||
if ('responseURL' in xhr) {
|
||||
return xhr.responseURL;
|
||||
}
|
||||
if (/^X-Request-URL:/m.test(xhr.getAllResponseHeaders())) {
|
||||
return xhr.getResponseHeader('X-Request-URL');
|
||||
}
|
||||
return;
|
||||
return null;
|
||||
}
|
||||
|
||||
export function stringToArrayBuffer(input: String): ArrayBuffer {
|
||||
|
||||
Reference in New Issue
Block a user