Skip to content
This repository has been archived by the owner on Nov 6, 2022. It is now read-only.

Parser error when parsing request line with a non standard HTTP method #92

Closed
pbuyle opened this issue Feb 17, 2012 · 3 comments
Closed

Comments

@pbuyle
Copy link

pbuyle commented Feb 17, 2012

I'm trying to serve PURGE request from a HTTP server implemented using Node.JS. PURGE requests are used by Squid and Varnish to purge objects from their cache (cf. http://wiki.squid-cache.org/SquidFaq/OperatingSquid#How_can_I_purge_an_object_from_my_cache.3F and https://www.varnish-cache.org/docs/trunk/tutorial/purging.html).

But Node.JS's HTTP server does let not my code serve non-standard HTTP method. Instead, when receiving a request line using a non-standard method, the server close the connection after a parser error. So it seems that http_parser does not support non-standard methods.

According to the HTTP 1.1 specification (rfc2616, section 5.1), the method of a request line can be any valid token. So it seems natural to expect an HTTP parser to accept any method in the request line. It is up to the parser user to properly handle unknown method.

@bnoordhuis
Copy link
Member

See #93.

@emberian
Copy link
Contributor

I'm going to try and take a whack at this tomorrow or tonight, in ways that conform to a and b in nodejs/node-v0.x-archive#3192

@jasnell
Copy link
Member

jasnell commented Oct 26, 2015

Closing. There's nothing to do on this at this point in time. More generalized HTTP method handling will be discussed as part of the HTTP WG (http://github.com/nodejs/http)

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

No branches or pull requests

4 participants