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

question: custom method support #3482

Closed
Oloompa opened this issue Dec 11, 2019 · 6 comments
Closed

question: custom method support #3482

Oloompa opened this issue Dec 11, 2019 · 6 comments

Comments

@Oloompa
Copy link

Oloompa commented Dec 11, 2019

On node it is not possible to use custom method even if RFC 2616 allow it. It was due to hard code allowed method list on http parser. see nodejs/node-v0.x-archive#3192

Does deno allow to use custom methods ?

@sholladay
Copy link

Why do people want to use HTTP but without following normal HTTP conventions? What is the use case?

@Oloompa
Copy link
Author

Oloompa commented Dec 17, 2019

To use an app protocol over HTTP. The use case is RPC using methods for procedure names.

RFC 2616 allow to extend basic methods with custom ones.

5.1.1 Method

The Method token indicates the method to be performed on the
resource identified by the Request-URI. The method is case-sensitive.

   Method         = "OPTIONS"                ; Section 9.2
                  | "GET"                    ; Section 9.3
                  | "HEAD"                   ; Section 9.4
                  | "POST"                   ; Section 9.5
                  | "PUT"                    ; Section 9.6
                  | "DELETE"                 ; Section 9.7
                  | "TRACE"                  ; Section 9.8
                  | "CONNECT"                ; Section 9.9
                  | extension-method
   extension-method = token

9 Method Definitions

The set of common methods for HTTP/1.1 is defined below. Although
this set can be expanded, additional methods cannot be assumed to
share the same semantics for separately extended clients and servers.

Why do you want to block this standard feature ?

@sholladay
Copy link

I'm not a Deno maintainer, but personally I don't implement something just because a standard allows for it. It's important to show a concrete use case that doesn't have a cleaner solution.

I would be willing to implement this in Pogo if Deno supports it.

@Oloompa
Copy link
Author

Oloompa commented Dec 19, 2019

The problem in node.js was that http parser was blocking the ability to use other methods that listed ones. It was deliberately blocked.

The question here is "is the http parser rigidity same as nodejs" ?

Your framework could not do it if deno block it.

@ry
Copy link
Member

ry commented Dec 19, 2019

@Oloompa No, you can use any verb:

[req.method, req.url, req.proto] = firstLine.split(" ", 3);

But as the one who imposed that restriction in Node, I would strongly discourage the use of verbs outside of the spec.

@ry ry closed this as completed Dec 19, 2019
@Oloompa
Copy link
Author

Oloompa commented Dec 19, 2019

@ry thanks for answer

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

No branches or pull requests

3 participants