jdc8 / wub

Automatically exported from code.google.com/p/wub
0 stars 0 forks source link

Issue with links with a trailing "/" (or without a trailing "/"). #28

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. check out latest version.
2. copy example.config to site.config
3. uncomment the "#nub" section from site.config
4. start the server.
5. browse to localhost:8080
6. Click on "server configuration".
7.  Click on "Add" in the nubs section.

What is the expected output? What do you see instead?

Expected to be prompted for userid/password in order to edit/add a nub.
instead I Get a static page that talks about the Nub domain.

The home page links to 
    http://localhost:8080/nub/nubs
A link from the static nub domain page links to
    http://localhost:8080/nub/nubs/

With a trailing "/", you do get prompted to login.

What version of the product are you using? 
version 3448

Please provide any additional information below.
I see a bunch of code dealing with URLs with trailing slashes.  I'm not sure if 
the main page is intended to link to nub/nubs/, or if the code is just supposed 
to work either way.

On a side note, 
Setting a password in the site.config in the nub section does not set the 
"password" var in Nub.tcl.

Original issue reported on code.google.com by tircnf on 9 Dec 2010 at 12:10

GoogleCodeExporter commented 9 years ago
This isn't an error, it's intentional.  There's a difference in nature and by 
specification between a URL fred and a URL fred/ ... they represent two 
different and distinct resources.  Most people, most of the time, conflate the 
two (and even believe that fred, fred/ and fred/index.html are equivalent, but 
they're not.

This domain distinguishes between the two.

Original comment by firstros...@gmail.com on 30 Apr 2011 at 1:59

GoogleCodeExporter commented 9 years ago

Original comment by mcc...@gmail.com on 30 Apr 2011 at 2:24

GoogleCodeExporter commented 9 years ago
I didn't do a very good job describing the problem here.  I think I understand 
what's going on now.

The "Server Configuration" link in index.tml needs to be changed from
 <p class='list2'><a href='/nub/nubs'>Server configuration</a></p>
to
 <p class='list2'><a href='/nub/nubs/'>Server configuration</a></p>

with a trailing slash.

If you click on the "Server Configuration" link from the main page, it 
navigates to 
http://localhost:8081/nub/nubs
and it looks like the proper form comes up. 

If you then click the [Add] button in the "New Nub" section, 
the system will navigate you to 
http://localhost:8081/nub/add
And show you information about the Nub domain.

If on the other hand you navigate to 
http://localhost:8081/nub/nubs/  (note the ending /)
The same Nub information screen comes up.

then click "Add" in the "New Nub" form, you are navigated to
http://localhost:8081/nub/nubs/add
(and prompted for a password).

I'm guessing the behavior is correct 
but that the link on the main page is wrong.

the Server configuration link should point to
http://localhost:8081/nub/nubs/
(note the trailing "/").

If not, clicking [add] the "New Nub" form will Redirect  you to the About 
domain handler instead of the Nub handler.

Original comment by tircnf on 30 Apr 2011 at 7:40