Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing test case for no :path header #85

Open
ThetaSinner opened this issue Dec 27, 2017 · 2 comments
Open

Missing test case for no :path header #85

ThetaSinner opened this issue Dec 27, 2017 · 2 comments

Comments

@ThetaSinner
Copy link

There is a test case for a :path with an invalid value, but no test for a missing :path header

@madgnome
Copy link
Contributor

It seems that this test

tg.AddTestCase(&spec.TestCase{
is a duplicate of
tg.AddTestCase(&spec.TestCase{
and should have been the test for missing :path

I will raise a PR.

@madgnome
Copy link
Contributor

madgnome commented Dec 4, 2018

There's already a test for missing :path

tg.AddTestCase(&spec.TestCase{
		Desc:        "Sends a HEADERS frame that omits \":path\" pseudo-header field",
		Requirement: "The endpoint MUST respond with a stream error of type PROTOCOL_ERROR.",
		Run: func(c *config.Config, conn *spec.Conn) error {
			var streamID uint32 = 1

			err := conn.Handshake()
			if err != nil {
				return err
			}

			headers := spec.CommonHeaders(c)
			headers = []hpack.HeaderField{
				headers[0], // :method
				headers[1], // :scheme
				headers[3], // :authority
			}

			hp := http2.HeadersFrameParam{
				StreamID:      streamID,
				EndStream:     true,
				EndHeaders:    true,
				BlockFragment: conn.EncodeHeaders(headers),
			}

			conn.WriteHeaders(hp)

			return spec.VerifyStreamError(conn, http2.ErrCodeProtocol)
		},
	})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants