< Great Moments In User Interface Design
Star Trek Nerd >

[Comments] (2) Apache Question: It looks like you can't use a text file to drive a RewriteMap if the URLs you're rewriting to are longer than 1024 bytes. Is this accurate? Does anyone else consider this a blot on mod_rewrite (as though it wasn't already bespeckled with blots)? I'm using a .dbm file instead, which doesn't have this problem, but it's aggravating.


Posted by Josh Myer at Mon Jan 10 2005 18:40

Welcome to the wonderful world of safe (but limited) design. I think I smell an fgets() or an fscanf() input routine. At least it's probably not overrunnable. Unless they forget to do their off-by-one magic correctly, then you could overwrite the NUL at the end of the string and god knows what happens next...

Nobody knows how to use realloc() appropriately anymore, it's a real shame. It would be less of a shame if they weren't abusing C, but, eh.

Posted by Gary Benson at Tue Jan 11 2005 05:39

Well, technically the initial line of the HTTP request is limited to 256 bytes which would allow about 244 bytes of URL after the hostname. Apache for one ignores this particular limit.

[Main] [Edit]

Unless otherwise noted, all content licensed by Leonard Richardson
under a Creative Commons License.