Skip to content

Commit

Permalink
#400 renamed headers property. Added line to readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
77bo committed Dec 11, 2017
1 parent a0490e3 commit 38b59fe
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/ngx-uploader/classes/interfaces.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions src/ngx-uploader/classes/ngx-uploader.class.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 });

Expand Down Expand Up @@ -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))
Expand Down

0 comments on commit 38b59fe

Please sign in to comment.