Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix the content type on the wire to be consistent with the C# implemetation. #1237

Merged
merged 1 commit into from
Oct 1, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ import { IHttpContentHeaders } from './Interfaces/IHttpContentHeaders';
export class HttpContentStream {
public readonly id: string;
public readonly content: HttpContent;
public description: { id: string; contentType: string; length: number; };
public description: { id: string; type: string; length: number; };

public constructor(content: HttpContent) {
this.id = generateGuid();
this.content = content;
this.description = {id: this.id, contentType: (this.content.headers) ? this.content.headers.contentType : "unknown", length: (this.content.headers) ? this.content.headers.contentLength : 0};
this.description = {id: this.id, type: (this.content.headers) ? this.content.headers.type : "unknown", length: (this.content.headers) ? this.content.headers.contentLength : 0};
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@
*/

export interface IHttpContentHeaders {
contentType?: string;
type?: string;
contentLength?: number;
}
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class StreamingRequest {
let stream = new SubscribableStream();
stream.write(body, 'utf8');
this.addStream(new HttpContent({
contentType: 'application/json; charset=utf-8',
type: 'application/json; charset=utf-8',
contentLength: stream.length
},
stream));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class StreamingResponse {
let stream = new SubscribableStream();
stream.write(JSON.stringify(body), 'utf8');
this.addStream(new HttpContent({
contentType: 'application/json; charset=utf-8',
type: 'application/json; charset=utf-8',
contentLength: stream.length
}, stream));
}
Expand Down