Auto merge of #27851 - ghostd:fix-nosniff, r=jdm

Fix some 'nosniff' tests

This PR implements some standard function to work with headers, hence it fixes some 'nosniff' test/

I create a PR as Draft because i have some questions:
* i added the code info the `net` module instead of `script::dom::headers` to avoid some cyclic dependencies... but i'm not sure about this choice. Is there another potential location to put this code?
* i used String object to match the spectification (it states to collect sequences of "code points", but some code use byte arrays. Should i change the code to work with bytes?

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [ ] These changes fix #___ (GitHub issue number if applicable)

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->
This commit is contained in:
bors-servo 2021-03-29 01:42:33 -04:00 committed by GitHub
commit 970a3b60da
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 182 additions and 15 deletions

View file

@ -8,6 +8,3 @@
[X-Content-Type-Options%3A%20nosniff%0C]
expected: FAIL
[X-Content-Type-Options%3A%20nosniff%2C%2C%40%23%24%23%25%25%26%5E%26%5E*()()11!]
expected: FAIL