CrowdHailer / Ace

HTTP web server and client, supports http1 and http2
https://hex.pm/packages/ace
MIT License
305 stars 26 forks source link

Fix handling of unknown Frame type #144

Closed varnerac closed 4 years ago

varnerac commented 4 years ago

Fix verified by h2spec test suite.

Before:

Hypertext Transfer Protocol Version 2 (HTTP/2)
  4. HTTP Frames
    4.1. Frame Format
      × 1: Sends a frame with unknown type
        -> The endpoint MUST ignore and discard any frame that has a type that is unknown.
           Expected: PING Frame (length:8, flags:0x01, stream_id:0, opaque_data:)
             Actual: Connection closed

After:

RESULT: Hypertext Transfer Protocol Version 2 (HTTP/2)
  4. HTTP Frames
    4.1. Frame Format
      ✔ 1: Sends a frame with unknown type
      ✔ 2: Sends a frame with undefined flag
      ✔ 3: Sends a frame with reserved field bit
CrowdHailer commented 4 years ago

Looks good. I wonder how easy it would be to run h2spec on travis.

varnerac commented 4 years ago

I am working on adding H2Spec tests wrapped in ExUnit. That's how I found this. It would provide code coverage of H2Spec stuff along with vanilla ExUnit tests.

varnerac commented 4 years ago

Bump