-
Notifications
You must be signed in to change notification settings - Fork 335
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
Setting the scheme to "file" should fail if there's a host or port #278
Comments
This is the root cause of servo/servo#15435 |
…ishearth Prevent the constellation from panicking if there is a deserialization error <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/15618) <!-- Reviewable:end -->
…re is a deserialization error (from asajeffrey:constellation-ipc-dont-panic); r=Manishearth <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 524a117ff6a5c3bda23e5bc702ef3f67f8df3fd1 --HG-- extra : subtree_source : https%3A//hg.mozilla.org/projects/converted-servo-linear extra : subtree_revision : 7f6bb6ccd9b821b2db5571ce87712c91ea326918
…re is a deserialization error (from asajeffrey:constellation-ipc-dont-panic); r=Manishearth <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 524a117ff6a5c3bda23e5bc702ef3f67f8df3fd1
…re is a deserialization error (from asajeffrey:constellation-ipc-dont-panic); r=Manishearth <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 524a117ff6a5c3bda23e5bc702ef3f67f8df3fd1
Should it really fail? This doesn’t match the spec at https://url.spec.whatwg.org/#dom-url-protocol In this test case: <a id=a href="http://example.net:8080/foo"></a>
<script>
var a = document.getElementById("a");
a.protocol = "file";
document.write(a.href)
</script> Firefox prints @annevk Do you think the spec should be changed to remove the port in this case and avoid leaving the URL in an inconsistent state? |
If you look at scheme state 2.1.3 it seems pretty clear there is a special case. It's not quite failure, but it shouldn't succeed. |
https://url.spec.whatwg.org/#scheme-state
If I understand this correctly, it means that setting the scheme to file for a URL that has credentials or a port specified should fail. |
It's a no-op from the perspective of JavaScript, it doesn't throw. That's what I meant with not quite failure. |
You're right @annevk. |
@SimonSapin: Similarly, this library behaves counterintuitively when parsing a data URL. In the JavaScript console in the latest Firefox:
Some weirdness with the protocol component/scheme, but no hostname or port number extracted from a data URL for sure. |
@sanmai-NL Data URLs do not include the //. |
@jdm: I know, a valid example is the counterexample in the Rust playground test case. |
For a data URL that includes // Firefox is incorrect there as the URL parser doesn't special case data URLs. |
…re is a deserialization error (from asajeffrey:constellation-ipc-dont-panic); r=Manishearth <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 524a117ff6a5c3bda23e5bc702ef3f67f8df3fd1 UltraBlame original commit: e838276dea72f9d0bf23a8cb9cce051b3285bad7
…re is a deserialization error (from asajeffrey:constellation-ipc-dont-panic); r=Manishearth <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 524a117ff6a5c3bda23e5bc702ef3f67f8df3fd1 UltraBlame original commit: e838276dea72f9d0bf23a8cb9cce051b3285bad7
…re is a deserialization error (from asajeffrey:constellation-ipc-dont-panic); r=Manishearth <!-- Please describe your changes on the following line: --> At the moment, the constellation panics if there is a deserialization error on an ipc channel. This happens in `/html/browsers/history/the-location-interface/location-protocol-setter-non-broken.html` due to the URL deserialization errors caused by servo/rust-url#278. This PR stops the constellation from panicking, so we can get a crash report for deserialization errors. --- <!-- 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 do not require tests because we don't test panic recovery <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> Source-Repo: https://github.com/servo/servo Source-Revision: 524a117ff6a5c3bda23e5bc702ef3f67f8df3fd1 UltraBlame original commit: e838276dea72f9d0bf23a8cb9cce051b3285bad7
This passes the proposed test, so I'm guessing it can be closed. I added the test in 7b8b841 just to make sure. |
The test case:
should pass, instead it fails with:
The resulting URL has a
file
scheme, and a host/port, so serialization fails.The text was updated successfully, but these errors were encountered: