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

Made binary files show an info message instead of garbled text. #7956

Merged
merged 1 commit into from Oct 31, 2015

Conversation

@gkbrk
Copy link
Contributor

gkbrk commented Oct 10, 2015

Content-types with the TopLevel "Application" such as

  • application/octet-stream
  • application/pdf

now show an info message instead of trying to view binary data as html.

Review on Reviewable

@highfive
Copy link

highfive commented Oct 10, 2015

Thanks for the pull request, and welcome! The Servo team is excited to review your changes, and you should hear from @pcwalton (or someone else) soon.

@gkbrk
Copy link
Contributor Author

gkbrk commented Oct 10, 2015

This should solve #7706 I think.

@jdm jdm self-assigned this Oct 10, 2015
@jdm
Copy link
Member

jdm commented Oct 10, 2015

Thanks for doing this work!
-S-awaiting-review +S-needs-code-changes


Reviewed 1 of 1 files at r1.
Review status: all files reviewed at latest revision, 2 unresolved discussions, some commit checks pending.


components/script/dom/servohtmlparser.rs, line 135 [r1] (raw file):
This does solve the problem, but I think we should move to a whitelisting model instead, ie. only continue parsing HTML for text/html, and display this for all others that we don't explicitly support.


components/script/dom/servohtmlparser.rs, line 136 [r1] (raw file):
Let's rename this to is_synthesized_content.


Comments from the review on Reviewable.io

@jdm
Copy link
Member

jdm commented Oct 10, 2015

-S-awaiting-review +S-needs-code-changes


Reviewed 1 of 1 files at r2.
Review status: all files reviewed at latest revision, 1 unresolved discussion, some commit checks pending.


components/script/dom/servohtmlparser.rs, line 142 [r2] (raw file):
This should be a None branch with a comment that it should be merged with the previous branch when #4212 is fixed.


Comments from the review on Reviewable.io

@gkbrk
Copy link
Contributor Author

gkbrk commented Oct 11, 2015

@jdm anything else I should change?

@jdm
Copy link
Member

jdm commented Oct 12, 2015

Nope! Just squash these three commits into one and we're good to merge!
-S-awaiting-review -S-fails-tidy +S-needs-squash


Reviewed 1 of 1 files at r3, 1 of 1 files at r4.
Review status: :shipit: all files reviewed at latest revision, all discussions resolved, all commit checks successful.


Comments from the review on Reviewable.io

@gkbrk
Copy link
Contributor Author

gkbrk commented Oct 12, 2015

@jdm I might have done the squash incorrectly, doesn't seem like there's a problem though.

@jdm
Copy link
Member

jdm commented Oct 12, 2015

@bors-servo: r+
Lovely!

@bors-servo
Copy link
Contributor

bors-servo commented Oct 12, 2015

📌 Commit 93721d8 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 12, 2015

Testing commit 93721d8 with merge db04716...

bors-servo pushed a commit that referenced this pull request Oct 12, 2015
Made binary files show an info message instead of garbled text.

Content-types with the TopLevel "Application" such as

* application/octet-stream
* application/pdf

now show an info message instead of trying to view binary data as html.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7956)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 12, 2015

💔 Test failed - linux-rel

@jdm
Copy link
Member

jdm commented Oct 12, 2015

Ah, presumably the server is giving us text/xhtml for .xhtml files. We should probably claim that we can deal with those, even though we don't have an XML parser yet.

@gkbrk
Copy link
Contributor Author

gkbrk commented Oct 12, 2015

@jdm So I'm adding text/xhtml to the match statement right?

@gkbrk
Copy link
Contributor Author

gkbrk commented Oct 12, 2015

@jdm http://www.w3.org/International/articles/serving-xhtml/ says xhtml has 3 possible mime types.

  • application/xhtml+xml
  • application/xml
  • text/xml

Which ones should I add?

@eefriedman
Copy link
Contributor

eefriedman commented Oct 12, 2015

Hopefully just application/xhtml+xml is sufficient. Treating arbitrary text/xml as HTML is likely to lead to weird results.

@bors-servo
Copy link
Contributor

bors-servo commented Oct 16, 2015

The latest upstream changes (presumably #8051) made this pull request unmergeable. Please resolve the merge conflicts.

@Manishearth
Copy link
Member

Manishearth commented Oct 31, 2015

Any updates?

@gkbrk
Copy link
Contributor Author

gkbrk commented Oct 31, 2015

@jdm @Manishearth Just updated the PR to compile and hopefully pass the xhtml tests.

@jdm
Copy link
Member

jdm commented Oct 31, 2015

@bors-servo: r+
Thanks!

@bors-servo
Copy link
Contributor

bors-servo commented Oct 31, 2015

📌 Commit aa7a391 has been approved by jdm

@bors-servo
Copy link
Contributor

bors-servo commented Oct 31, 2015

Testing commit aa7a391 with merge f432c3c...

bors-servo added a commit that referenced this pull request Oct 31, 2015
Made binary files show an info message instead of garbled text.

Content-types with the TopLevel "Application" such as

* application/octet-stream
* application/pdf

now show an info message instead of trying to view binary data as html.

<!-- Reviewable:start -->
[<img src="https://reviewable.io/review_button.png" height=40 alt="Review on Reviewable"/>](https://reviewable.io/reviews/servo/servo/7956)
<!-- Reviewable:end -->
@bors-servo
Copy link
Contributor

bors-servo commented Oct 31, 2015

@bors-servo bors-servo merged commit aa7a391 into servo:master Oct 31, 2015
2 of 3 checks passed
2 of 3 checks passed
code-review/reviewable Review in progress: 0 of 1 files reviewed, all discussions resolved
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
homu Test successful
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

6 participants
You can’t perform that action at this time.