Skip to content

Commit f5cee7f

Browse files
committed
Minor updates to documentation
1 parent f5c2639 commit f5cee7f

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ It provides a number of conveniences and tries to promote safety wherever possib
1313
* **Middleware "filters"**
1414
Filters are decorators around `Service`s; in Typhon servers and clients share common functionality by composing it functionally.
1515

16-
* **Body encoding/decoding**
16+
* **Body encoding and decoding**
1717
Marshalling and unmarshalling request bodies to structs is such a common operation that our `Request` and `Response` objects support them directly. If the operations fail, the errors are propagated automatically since that's nearly always what a server will want.
1818

1919
* **Propagation of cancellation**
@@ -22,6 +22,10 @@ It provides a number of conveniences and tries to promote safety wherever possib
2222
* **Error propagation**
2323
Responses have an inbuilt `Error` attribute, and serialisation/deserialisation of these errors into HTTP errors is taken care of automatically. We recommend using this in conjunction with [`monzo/terrors`].
2424

25+
* **Full HTTP/1.1 and HTTP/2.0 support**
26+
Applications implemented using Typhon can communicate over HTTP/1.1 or HTTP/2.0. Typhon has support for full duplex communication under HTTP/2.0, and [`h2c`] (HTTP/2.0 over TCP, ie. without TLS) is also supported if required.
27+
2528
[`net/http`]: https://golang.org/pkg/net/http/
2629
[platform blog post]: https://monzo.com/blog/2016/09/19/building-a-modern-bank-backend/
2730
[`monzo/terrors`]: http://github.com/monzo/terrors
31+
[`h2c`]: https://httpwg.org/specs/rfc7540.html#discover-http

h2c.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ import (
1818
// H2cFilter adds HTTP/2 h2c upgrade support to the wrapped Service (as defined in RFC 7540 §3.2, §3.4).
1919
func H2cFilter(req Request, svc Service) Response {
2020
h := req.Header
21-
// h2c with prior knowledge (RFC 7540 Section 3.4)
21+
// h2c with prior knowledge (RFC 7540 §3.4)
2222
isPrior := (req.Method == "PRI" && len(h) == 0 && req.URL.Path == "*" && req.Proto == "HTTP/2.0")
23-
// h2c upgrade (RFC 7540 Section 3.2)
23+
// h2c upgrade (RFC 7540 §3.2)
2424
isUpgrade := httpguts.HeaderValuesContainsToken(h[textproto.CanonicalMIMEHeaderKey("Upgrade")], "h2c") &&
2525
httpguts.HeaderValuesContainsToken(h[textproto.CanonicalMIMEHeaderKey("Connection")], "HTTP2-Settings")
2626
if isPrior || isUpgrade {

0 commit comments

Comments
 (0)