diff options
author | bors-servo <lbergstrom+bors@mozilla.com> | 2019-11-18 17:31:47 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-11-18 17:31:47 -0500 |
commit | 18ab860f4cac5520306b09f8ab6b0e2f1539a2cf (patch) | |
tree | 50f78775f77ee7018335718df691666bbcc4f950 /components/script/dom/bindings/codegen/Codegen.py | |
parent | 2a5b7be557001ef118f4f1aa71f358f8a4f3d171 (diff) | |
parent | e73528e5fc834a5fe37fdcefb3b87f1b87a23241 (diff) | |
download | servo-18ab860f4cac5520306b09f8ab6b0e2f1539a2cf.tar.gz servo-18ab860f4cac5520306b09f8ab6b0e2f1539a2cf.zip |
Auto merge of #24669 - glowe:issue-24628/set-mime-type, r=jdm
Set response mime_type based on Content-Type
<!-- Please describe your changes on the following line: -->
Set the response's `mime_type` based on its `Content-Type` header whenever `Response::set_headers` is called. This ensures that `mime_type` is always consistent with `Content-Type`. The other reason for going with this approach is it relies on `extract_mime_type`: https://github.com/servo/servo/blob/afbcbf75eaa63ff0eec8fd3858e9155eb8dbadaa/components/script/dom/headers.rs#L260-L261
Besides the consistency argument, I also expect that we'll update the `extract_mime_type` method to conform with its specification.
Another option I explored was adding a `set_mime_type` member to `Response` and calling that with the mime type from `Metadata::content_type` in `FetchResponseListener::process_response`. I decided against this since it expanded the interface of `Response` and didn't have the same benefits of the first option.
Fixes #24628.
---
<!-- 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
- [x] These changes fix #24628.
<!-- Either: -->
- [x] There are tests for these changes
<!-- 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. -->
Diffstat (limited to 'components/script/dom/bindings/codegen/Codegen.py')
0 files changed, 0 insertions, 0 deletions