So in theory when we deserialize a header, we should fail if the provided value does not correspond to this definition.
We should probably handle the validation upfront so that the deserialization can no longer fail. When we encounter an invalid header we could either throw an invalid argument error, or come up with a new invalid header error, which could be useful for Puppeteer, which is explicitly checking for such errors in the implementation.
For the
headers
parameter of thenetwork.continueRequest
command, we are not validating that the header names and values will lead to valid headers.A header is defined in fetch as
So in theory when we deserialize a header, we should fail if the provided value does not correspond to this definition.
We should probably handle the validation upfront so that the deserialization can no longer fail. When we encounter an invalid header we could either throw an invalid argument error, or come up with a new invalid header error, which could be useful for Puppeteer, which is explicitly checking for such errors in the implementation.