ftp://address without a trailing slash returns a blank listing

VERIFIED FIXED

Status

()

Core
Networking
P3
normal
VERIFIED FIXED
18 years ago
18 years ago

People

(Reporter: John Morrison, Assigned: Judson Valeski)

Tracking

Trunk
x86
Linux
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

(URL)

(Reporter)

Description

18 years ago
If I go to 

   ftp://ftp.mozilla.org/pub

I get a blank ftp listing. However, if I add a trailing slash

   ftp://ftp.mozilla.org/pub/

then I get the correct listing.

linux 2000042509

Comment 1

18 years ago
cc-ing Judson, I remember that it makes a difference for the ftp protocol if
there is a slash or not

Comment 2

18 years ago
What's the expected result: just display it, or add a trailing slash and then 
display it?

Comment 3

18 years ago
for consistency this should add a trailing slash and then display it. ->jud
Assignee: gagan → valeski
(Assignee)

Comment 4

18 years ago
well, we can't just append one because ftp url's without a trailing slash have 
special meaning.
Status: NEW → ASSIGNED
(Assignee)

Comment 5

18 years ago
over to waterson. There's something funky going on in the directory viewer 
believe it or not.

http://lxr.mozilla.org/seamonkey/source/xpfe/components/directory/nsDirectoryVie
wer.cpp#1158

mInner is null which causes the dir viewer to fail which causes the channel to 
be cancelled before it has a chance to push data out.
Assignee: valeski → waterson
Status: ASSIGNED → NEW

Comment 6

18 years ago
rjc: this looks like you...
Assignee: waterson → rjc

Comment 7

18 years ago
Jud: what do you mean when you say "well, we can't just append one because ftp 
url's without a trailing slash have special meaning."

Can't you append the slash to the FTP URL *AFTER* you've determined that its a 
directory?  This is what I was planning on having the directory viewer do... 
however, I'd prefer to see the FTP protocol itself do it.

I'd like to understand what you mean by "special meaning".
(Assignee)

Comment 8

18 years ago
FTP servers can interpret a chdir lacking a trailing slash to mean "log the user 
into their home directory" and a chdir including a trailing slash to "log the 
user into the default directory."

The URL bar should be updated with whatever the URL spec is once the consumer 
has received the OnStartRequest callback.

FTP may or may not append a trailing slash, it's up to the server.

Comment 9

18 years ago
I'm fixing this bug by testing that if its a "ftp://" URL and its a HTTP-INDEX 
mimetype, then ensure that the URL ends with a slash.

However, this really seems like something that Necko should be doing instead of 
the observer.
Status: NEW → RESOLVED
Last Resolved: 18 years ago
Resolution: --- → FIXED
(gagan from rjc's desk) jud: what you are saying is only applicable for the root 
directory and in this case (as well as any other case) we should update the URL 
with the response to CWD command (append to hostname) on the FTP connection. I 
think this bug still needs to be fixed from that perspective, reopening. 

rjc adds- you might want to back out my changes when you get a chance to fix 
this. 
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
.
Assignee: rjc → valeski
Status: REOPENED → NEW
(Assignee)

Comment 12

18 years ago
gagan: no, I'm saying this for whatever the server sends back. the CWD command 
may or may not return something with a trailing slash.
Status: NEW → RESOLVED
Last Resolved: 18 years ago18 years ago
Resolution: --- → FIXED
Jud: I'm still confused. (Sorry, long week!) Irregardless of whether CWD returns 
something with a trailing slash or not, if CWD succeeds, aren't you guaranteed 
that what was returned is a directory?  (Meaning, that you could append a slash 
if needed.)

Comment 14

18 years ago
verif.
Linux 2000071308
Status: RESOLVED → VERIFIED
You need to log in before you can comment on or make changes to this bug.