From 38b59fe7ac37b5d177d393a81f54ced863ae691a Mon Sep 17 00:00:00 2001 From: Bohdanko <32868658+77bo@users.noreply.github.com> Date: Mon, 11 Dec 2017 11:26:36 +0200 Subject: [PATCH] #400 renamed headers property. Added line to readme. --- README.md | 1 + src/ngx-uploader/classes/interfaces.ts | 2 +- src/ngx-uploader/classes/ngx-uploader.class.ts | 4 ++-- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 6e0037ec..c1dd2a2d 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,7 @@ export interface UploadFile { progress: UploadProgress; response?: any; // response when upload is done (parsed JSON or string) responseStatus?: number; // response status code when upload is done + responseHeaders?: { [key: string]: string }; // response headers when upload is done } // output events emitted by ngx-uploader diff --git a/src/ngx-uploader/classes/interfaces.ts b/src/ngx-uploader/classes/interfaces.ts index bdf718ac..5e38ef8c 100644 --- a/src/ngx-uploader/classes/interfaces.ts +++ b/src/ngx-uploader/classes/interfaces.ts @@ -42,7 +42,7 @@ export interface UploadFile { responseStatus?: number; sub?: Subscription | any; nativeFile?: File; - headers?: { [key: string]: string }; + responseHeaders?: { [key: string]: string }; } export interface UploadOutput { diff --git a/src/ngx-uploader/classes/ngx-uploader.class.ts b/src/ngx-uploader/classes/ngx-uploader.class.ts index 135f785c..01ce6ec1 100644 --- a/src/ngx-uploader/classes/ngx-uploader.class.ts +++ b/src/ngx-uploader/classes/ngx-uploader.class.ts @@ -205,7 +205,7 @@ export class NgUploaderService { file.response = xhr.response; } - file.headers = this.parseResponseHeaders(xhr.getAllResponseHeaders()); + file.responseHeaders = this.parseResponseHeaders(xhr.getAllResponseHeaders()); observer.next({ type: 'done', file: file }); @@ -300,7 +300,7 @@ export class NgUploaderService { private parseResponseHeaders(httpHeaders: ByteString) { if (!httpHeaders) { - return null; + return; } return httpHeaders.split('\n') .map(x => x.split(/: */, 2))