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

Rest-adapter errorHandler set content-type json #390

Merged
merged 1 commit into from
Dec 7, 2016

Conversation

davidcheung
Copy link
Contributor

@davidcheung davidcheung commented Dec 6, 2016

the defaultHandler always res.sends an object
therefore make sense to always set response header as such

related to strongloop/loopback-component-storage#179

@davidcheung davidcheung self-assigned this Dec 6, 2016
@bajtos bajtos self-assigned this Dec 7, 2016
@@ -210,6 +210,24 @@ describe('strong-remoting-rest', function() {
.end(done);
});

it('should use `content-type: application/json` for default errorHandler',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please add a comment before this test case with a link to the github issue this test is reproducing?


request(app).get(method.url)
.expect(500)
.expect('content-type', 'application/json; charset=utf-8', function(err) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can simplify this line:

.expect('content-type', '...', done);

Copy link
Member

@bajtos bajtos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two nitpicks, the change LGTM otherwise. No further reviews are needed.

the defaultHandler always res.sends an object
therefore make sense to always set response header as such
@davidcheung
Copy link
Contributor Author

@slnode test please

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants