soheilhy / cmux

Connection multiplexer for GoLang: serve different services on the same port!
Apache License 2.0
2.57k stars 196 forks source link

Add matchers for header value prefixes #50

Closed bufdev closed 7 years ago

bufdev commented 7 years ago

This adds matchers to check the prefix of a header value instead of equality with a header value. This is so that correct matching of the gRPC content-type header can be done - note that per https://grpc.io/docs/guides/wire.html, application/grpc is just the prefix, and an encoding type can be added afterwards. This is something I am working on in https://github.com/grpc/grpc-go/pull/1203 and will have a new PR that implements this per the discussion on that PR soon.

bufdev commented 7 years ago

I believe the test failure is an unrelated flaky test, this should be good to go and that test should be fixed separately. This was a failure on only one of the four runs (1.6, 1.7, 1.8, tip).

https://travis-ci.org/soheilhy/cmux/jobs/264425608

29.05s$ go test -bench . -v ./...
=== RUN   TestTimeout
--- FAIL: TestTimeout (0.40s)
    cmux_test.go:315: testTimeout failed: any rule did not match
mhamrah commented 7 years ago

+1

soheilhy commented 7 years ago

Thanks for the feature. Please rebase and push. Let's see if all the tests pass.

bufdev commented 7 years ago

All green!

bufdev commented 7 years ago

After merging this, can you quickly do a release?