Closed Bug 215866 Opened 21 years ago Closed 21 years ago

Unknown gopher document types give strange error message

Categories

(Core :: Networking, defect, P4)

x86
Linux
defect

Tracking

()

RESOLVED FIXED
mozilla1.8alpha1

People

(Reporter: tthurman, Assigned: bzbarsky)

References

()

Details

Attachments

(1 file, 1 obsolete file)

User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030715 Mozilla Firebird/0.6 Build Identifier: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.5a) Gecko/20030715 Mozilla Firebird/0.6 Unknown document types in gopher: URLs cause a new, blank page to be displayed containing only the words 3Unknown Selector String . which is strangely formatted. I would have expected no "3" and no space before the final full stop. (For consistency, this should really be a matter for an error dialogue box, as seen when an unknown protocol is found in a URL.) FYI, the document type "h" is in commonly use (it means text/html), but isn't one of the original set listed in RFC 1436. It would be good if Moz supported it, but that's not the point of this bug: the point is the strange error message. Reproducible: Always Steps to Reproduce: 1. Go to gopher://sipb.mit.edu/ 2. Click the last entry, "New e-mail directory (http://usenet-addresses.mit.edu/)" Or just go to gopher://sipb.mit.edu/hH:usenet-addresses.html
Blocks: 194220
Moving over to Networking
Assignee: blake → darin
Component: General → Networking
Product: Firebird → Browser
QA Contact: asa → benc
Version: unspecified → Trunk
Actually, that's not an error message generated by Mozilla. That's the data returned by the server. Just try replacing the 'h' by a '0' in the URL and see that that does not affect the data (although it does change the rendering a bit, since we render it as HTML, not plaintext). In any case, I'll attach a patch to add support for 'h'; I'm losing my net connection later tonight, so someone else will need to drive the patch in.
Attached patch patch (obsolete) — Splinter Review
Comment on attachment 129629 [details] [diff] [review] patch >@@ -731,13 +732,13 @@ nsGopherChannel::PushStreamConverters(ns > listener, > mUrl, > getter_AddRefs(converterListener)); > break; > } > if (NS_FAILED(rv)) return rv; >- } else if (mType=='0') { >+ } else if (mType == '0' || mType == 'h') { > // Convert general file > rv = StreamConvService->AsyncConvertData(NS_LITERAL_STRING("text/plain").get(), > NS_LITERAL_STRING("text/html").get(), > listener, > mListenerContext, > getter_AddRefs(converterListener)); This is wrong. 0 is a text file type, but we pass it through a convertor so that urls are linkified, and so on (which is why we return an http content type). That shouldn't be needed for things which really are HTML.
Attachment #129629 - Flags: review-
can this one be moved to status 'new'? The bug is showing as described.
Attachment #129629 - Attachment is obsolete: true
Comment on attachment 146392 [details] [diff] [review] So this is all it needs, then? Assuming I understand the situation correctly....
Attachment #146392 - Flags: review?(bbaetz)
Comment on attachment 146392 [details] [diff] [review] So this is all it needs, then? Probably. Don't forget to test it :)
Attachment #146392 - Flags: review?(bbaetz) → review+
Any suggestions on how to test past loading a few gopher sites with /h and making sure they run through our HTML parser (which they do)?
Attachment #146392 - Flags: superreview?(darin)
Comment on attachment 146392 [details] [diff] [review] So this is all it needs, then? rs=darin
Attachment #146392 - Flags: superreview?(darin) → superreview+
Taking.
Assignee: darin → bzbarsky
Status: UNCONFIRMED → NEW
Ever confirmed: true
Priority: -- → P4
Target Milestone: --- → mozilla1.8alpha
Fixed.
Status: NEW → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: