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: throw on GET & HEAD request body #43

Closed
wants to merge 1 commit into from

Conversation

ronag
Copy link
Member

@ronag ronag commented May 3, 2020

No description provided.

@@ -70,13 +70,14 @@ class Request extends AsyncResource {
}
this.path = opts.path

// TODO we should validate that the http method accepts a body or not
if (!isValidBody(opts.body)) {
if (opts.body && (this.method === 'GET' || this.method === 'HEAD')) {
Copy link
Member Author

Choose a reason for hiding this comment

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

I think HEAD and GET are the only methods where a body is not allowed?

@ronag
Copy link
Member Author

ronag commented May 3, 2020

Close due to discussion in #35

@ronag ronag closed this May 3, 2020
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.

1 participant