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

Useful helper methods for common http scenarios #429

Closed
davidfowl opened this issue Oct 5, 2015 · 4 comments
Closed

Useful helper methods for common http scenarios #429

davidfowl opened this issue Oct 5, 2015 · 4 comments
Milestone

Comments

@davidfowl
Copy link
Member

I was looking at golang's standard library and they have a pretty beefy http package https://golang.org/pkg/net/http. Here are a few that seemed interesting:

https://golang.org/pkg/net/http/#Request.WriteProxy
https://golang.org/pkg/net/http/#ServeContent
https://golang.org/pkg/net/http/#Request.SetBasicAuth (sorry @blowdart 😄 )
https://golang.org/pkg/net/http/#DetectContentType
https://golang.org/pkg/net/http/#MaxBytesReader

@blowdart
Copy link
Member

blowdart commented Oct 5, 2015

I'm surprised you're not saying sorry about DetectContentType - that is way more concerning than Basic Auth, although at least they're not picking some of the more dangerous ones.

@Tratcher
Copy link
Member

Tratcher commented Oct 5, 2015

  • WriteProxy is for clients, not servers.
  • Some subset of ServeContent might be useful, especially for last modified, range requests, if-modified-since, etc.. I'd make them specify the content-type though. MVC already handles many of these, correct? Static files implements them, but that implementation wouldn't be generally applicable because it relies on SendFile.
  • People want MaxBytesReader, there were several 3rd party implementations for WebApi2 and OWIN/Katana.

@muratg muratg added this to the 1.0.0 backlog milestone Oct 5, 2015
@davidfowl
Copy link
Member Author

WriteProxy is for clients, not servers.

Not sure what you mean. If you look at their API it writes to a "Stream" equivalent. This might be any network stream that is proxying requests over to another server even. It doesn't need to map directly to HttpClient.

MVC already handles many of these, correct? Static files implements them, but that implementation wouldn't be generally applicable because it relies on SendFile.

Moving building blocks into HttpAbstractions would be great. Even simpler versions that didn't rely on MVC intrinsics would be a good start.

@muratg muratg modified the milestones: Backlog, 1.0.0 backlog Dec 11, 2015
@muratg
Copy link

muratg commented Dec 11, 2015

@davidfowl Moving out of V1. If you think this is a MUST, bring it back

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