Skip to content
This repository has been archived by the owner on Apr 22, 2023. It is now read-only.

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

Merged
2 commits merged into from
Nov 17, 2010
Merged

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

2 commits merged into from
Nov 17, 2010

Conversation

TooTallNate
Copy link

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
Copy link

ry commented Oct 13, 2010

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

@TooTallNate
Copy link
Author

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
Copy link

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
Copy link
Author

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
Copy link

tj commented Nov 17, 2010

M-SEARCH?? what the hell.. lol

@TooTallNate
Copy link
Author

1255438 closes this....

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

Successfully merging this pull request may close these issues.

3 participants