heph icon indicating copy to clipboard operation
heph copied to clipboard

Release Heph-HTTP

Open Thomasdezeeuw opened this issue 3 years ago • 2 comments

Incomplete list from while I was working on the code:

  • [ ] Add README file.
  • [x] #494.
  • [x] #495.
  • [ ] #496.
  • [x] #497.
  • [x] #499.
  • [ ] Testing:
    • [ ] client module.
      • [ ] Testing: Client::read_chunk and down.
    • [ ] server module.
      • [ ] HTTP/1.0 requests.
      • [ ] Pipeline requests and responses.
      • [ ] Are non-read body dropped from the connection:
        • [ ] Oneshot (with Content-Length).
        • [ ] Chunked.
        • [ ] Chunked very-long... at some we want to stop reading...
        • [ ] RFC 7230 section 3.3.3 point 5.
      • [ ] Connection::send_response:
        • [ ] User setting Content-Length header.
        • [ ] User setting Transfer-Encoding header.
        • [ ] User setting Date header.
        • [ ] Automaitcally setting Connection header for HTTP/1.0.
        • [ ] No body and "Content-Length: 0" for:
          • [ ] 100..=199 Status Code.
          • [ ] 204 Status Code.
          • [ ] 304 Status Code.
        • [ ] Automaitcally setting Transfer-Encoding header for chunked body.
      • [ ] Body::recv.
      • [ ] Body::recv_vectored.
      • [ ] Body::read_all.
      • [ ] Body as Body in another request.
    • [ ] body module: #503.
    • [ ] handler module.
  • [ ] Expand crate documentation, including examples.
  • [ ] Review: src/server.rs.
  • [ ] Review: src/client.rs.
  • [ ] Review: src/body.rs.

Maybe

  • [ ] ~~Always set TCP_NODELAY on server::Connection. Not possible to do in ArgMap.~~ Leaving this up to the user.
  • [ ] Accept length: Option<NonZeroUsize> in FileBody::new.

IDEAS

  • [ ] Create a higher level API, perhaps in a service module.
  • [ ] FromRequest trait that allow parsing helpers, e.g. Json, Query, etc.
  • [ ] IntoResponse trait that allow deserialisors helpers, e.g. Json.
  • [x] Service trait: #491.
  • [x] Middleware trait: #492.
  • [ ] Router type: #493.

Check RFCs

Go through RFC for correctness, test for each section/requirement in them.

Create tests for each section/paragraph from the RFCS:

  • [ ] RFC 7230 - HTTP Message Syntax and Routing
  • [ ] RFC 7231 - HTTP Semantics and Content
  • [ ] RFC 7232 - HTTP Conditional Requests
  • [ ] RFC 7233 - HTTP Range Requests
  • [ ] RFC 7234 - HTTP Caching
  • [ ] RFC 7235 - HTTP Authentication
  • [ ] RFC 7236 - HTTP Authentication Scheme Registrations
  • [ ] RFC 7237 - HTTP Method Registrations
  • [ ] RFC 7238 - HTTP Status Code 308 (Permanent Redirect)
  • [ ] RFC 7239 - Forwarded HTTP Extension
  • [ ] RFC 7240 - Prefer Header for HTTP
  • [ ] RFC 5789 - PATCH Method for HTTP

Search for more HTTP related RFCs.

Related RFCs:

HTTP relies upon the Uniform Resource Identifier (URI) standard [RFC3986].

Transport Layer Security (TLS, [RFC5246]).

Obsolete RFCs

  • RFC 2616
  • RFC 2145

Thomasdezeeuw avatar May 24 '21 15:05 Thomasdezeeuw

Have you considered using the http crate? It would be of great benefit to the ecosystem for it to see more adoption.

ibraheemdev avatar Aug 13 '21 19:08 ibraheemdev

@ibraheemdev I know of the http crate, the problem is that it uses the bytes crate underneath and I don't think that's needed. But I'm considering a feature to support http and a more higher-level API.

Thomasdezeeuw avatar Aug 13 '21 19:08 Thomasdezeeuw