Hey all, fell off the map for quite a while; but I've been keeping
tabs on TiddlyWeb, watching things progress nicely. I'm still using
TiddlyWeb and MonkeyGTD regularly, and have been meaning to give
feedback for a long time.

Recently I undertook to switch from using TiddlyWeb via CherryPy to
using TiddlyWeb under mod_wsgi in Apache.

After some flailing around I got it working. I'd be embarrased to say
just how long I spent before discovering I needed a trailing slash at
the end of the URL when opening the top level tiddlyweb page. Now
after investigating a different problem, I can see why that trailing
slash is required.

Now about the problem mentioned in the subject:

I skipped some background info, so the relevance to TiddlyWeb may not
be immediately obvious to anyone that just stumbles on this.

The problem concerns how Apache handles encoded characters in URIs.
Particularly problematic for TiddlyWeb is that it affects forward
slashes (which are encoded as %2F).

Firstly, I found out Chris is already fully aware of the issue and
posted a comment on Apache's Bugzilla: 
https://issues.apache.org/bugzilla/show_bug.cgi?id=35256.

Considering this bug has been open since the middle of 2005, a fix on
Apache's end doesn't look to be in the pipeline. In the interim I was
curious about any thoughts on solving this on the TiddlyWeb side. I'm
basically planning on throwing in some sort of hack as a band-aid.

If the PATH_INFO variable was simply left undecoded we wouldn't have
this problem. It's a bit weird because the REQUEST_URI variable does
what we want and leaves %2F alone:

Example
I have a simple wsgi script mounted at /test in Apache. It checks the
values of the variables REQUEST_URI and PATH_INFO .

- Given this address:
http://localhost/test/mothersday-05%2F10%2F2009

- Here's the output in the browser:

REQUEST_URI: /test/mothersday-05%2F10%2F2009
SCRIPT_NAME: /test
PATH_INFO: /mothersday-05/10/2009

The problem is each %2F in the address gets decoded to a / in
PATH_INFO. We want PATH_INFO to contain: /mothersday-05%2F10%2F2009.

One quick hack would be to copy part of REQUEST_URI into PATH_INFO,
something like:

PATH_INFO = str.replace(SCRIPT_NAME, "", 1)

I'm not sure where this would go, maybe in the __call__ method of the
Environator?

I have a feeling there are many potential solutions that would fit the
bill, so I'm curious to hear any others.

By the way, I encountered this problem because I wanted to create todo
tiddlers with dates in the title, like: 05/10/2009 Mother's day.

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" 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/TiddlyWikiDev?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to