Add support for UPnP-defined HTTP request methods. #345

Merged
2 commits merged into from Nov 17, 2010

3 participants

@TooTallNate

This patch depends on the patch I've made for http-parser.

It adds support for 4 new HTTP request methods to be parsable and handleable with an http.Server. The new methods are M-SEARCH, NOTIFY, SUBSCRIBE, and UNSUBSCRIBE.

Also included is a test script testing for the M-SEARCH request method, and the * url.

@ry
ry commented Oct 13, 2010

ugh. more http methods? where do these come from?

@TooTallNate

Ugghh, indeed. These ones come from UPnP specifications.

Side Note: I hate the hard-coding of the HTTP methods personally, especially since http.Client doesn't have that same restriction (you can send arbitrary HTTP methods without modifying the source). If we modified the parser to return a String of the method, rather than an enum, we could probably save code and not have to worry about implementing any other HTTP methods as they come up. Thoughts?

@ry
ry commented Oct 18, 2010

I want to discourage people from thinking that extension methods are an acceptable idea. The change needs to be done at the parser level... However I think the http zealots may win out on this. mnot mentioned that he also wants extension methods...

@TooTallNate

It's not so much extension methods that I care about. Personally I think that they're a terrible idea, and that the 4 new method's I'm introducing could have been better taken care of using POST and special URI's or something similar. But, as it is, I'm against discriminating against certain "extension" methods while there's still a good amount of them already in the parser. That's why I feel like keeping node and the parser HTTP-method-agnostic is a good idea, so that as new specs continue coming, the parser/node don't need to continually be updated to reflect.

In the end ry, I'm just trying to implement UPnP through Node. 90% of it is HTTP-based (though at times with unconventional methods), so I figured using Node's HTTP library was entirely appropriate, but I needed to implement those few HTTP methods to do it right.

@tj
tj commented Nov 17, 2010

M-SEARCH?? what the hell.. lol

@TooTallNate

1255438 closes this....

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment