Rainy schrieb:

Hi tgers,

I'm using registration module and I found a source of a problem in my
app I spoke of before. The problem was that I went to url
/registration/edit_user/ . When it sent results to update_user
function, and then went back to edit_user, it would append the name of
update function to the URL, like this:
/registration/edit_user/update_user . edit_user's second passed
variable is tg_errors (after self), and with this url, it would get
"update_user" instead of tg_errors dictionary. Therefore things would
not work, errors would get lost and there was no way to figure out why.
The way to fix this is to go to /registration/edit_user (note no
trailing slash) in the first place. Since I fixed the template with the
URL that had trailing slash, I'm not looking for a fix anymore,
however, I'd like to hear comments, why does this happen and how?

I searched the group and I found something about trailing slashes but
no conclusive explanation and nothing exactly about this case. Should I
file the bug?

This doesn't seem right to me because to the user, a url with or
without trailing slash seems to look the same, and it should work the
same. Trailing slash may signify a directory, but you can't have dir
and file with the same name, at least in unix. I'm pretty sure in
windows, too.

You're wrong. It is not the same thing, and it isn't always the same thing in unix. For example

cp -r foo bar

will copy the directory foo recursively into the directory bar, whereas

cp -r foo/ bar

will only copy foo's contents.

The difference in HTTP is: a trailing slash marks a directory, which is usually served by http servers by applying some default file/suffix, like index.html.

Most webservers also will silently send a redirect in case a user doesn't enter the trailing slash, but there is no file/whatever found to serve under that path.

Now when the browser encounters an href/src/whatever reference to a relative path, it will build the generated request url by analyzing the currently visited path. If the path is without a trailing slash, the relative url will be applied to the above directory, whereas an url with a trailing slash _is_ the above directory.

Diez

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TurboGears" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/turbogears?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to