You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by "Brett E." <br...@fastclick.com> on 2004/02/06 19:33:17 UTC

Patch for query string customization?

Would the powers that be accept a patch which would define the query 
string as a macro, possibly specified in configure and with sane 
defaults of course?



Thanks,

Brett


Re: Patch for query string customization?

Posted by "Brett E." <br...@fastclick.com>.
Joshua Slive wrote:

> On Mon, 9 Feb 2004, Brett E. wrote:
> 
>>We recommend that HTTP server implementors, and in particular, CGI
>>implementors support the use of ";" in place of "&" to save authors the
>>trouble of escaping "&" characters in this manner.
> 
> 
>>So maybe we should conform to the spec and support both styles.
> 
> 
> Huh?  This has nothing to do with the character that marks the start of
> query strings "?".  It is dealing with the character that delineates
> variables within a query string ("&" or ";").  Apache doesn't care at all
> about what comes after the "?", except in limitted cases like
> mod_autoindex (which already uses the ";" delimiter rather than "&").
> 
> You should be looking at whatever program or module is interpreting the
> query string.  The base apache code has nothing to do with it.
> 
> Joshua.
> 
True, thank you.



Re: Patch for query string customization?

Posted by Joshua Slive <jo...@slive.ca>.
On Mon, 9 Feb 2004, Brett E. wrote:
> We recommend that HTTP server implementors, and in particular, CGI
> implementors support the use of ";" in place of "&" to save authors the
> trouble of escaping "&" characters in this manner.

> So maybe we should conform to the spec and support both styles.

Huh?  This has nothing to do with the character that marks the start of
query strings "?".  It is dealing with the character that delineates
variables within a query string ("&" or ";").  Apache doesn't care at all
about what comes after the "?", except in limitted cases like
mod_autoindex (which already uses the ";" delimiter rather than "&").

You should be looking at whatever program or module is interpreting the
query string.  The base apache code has nothing to do with it.

Joshua.

Re: Patch for query string customization?

Posted by "Brett E." <br...@fastclick.com>.
André Malo wrote:

> * "Brett E." <br...@fastclick.com> wrote:
> 
> 
>>Sorry for the confusion. I meant is it possible to use a #define macro 
>>for the query string delimiter. Ie, everywhere we use '?' in the code, 
>>use say QUERY_STRING_DELIM. For example:
>>
>>modules/mappers/mod_rewrite.c:
>>
>>     q = strchr(r->filename, '?');
>>
>>to
>>
>>     q = strchr(r->filename, QUERY_STRING_DELIM);
>>
>>..everywhere in the code.
> 
> 
> I think, no. The question mark as query string delimiter is well defined in
> several RFCs. Since we implement HTTP, there's no reason to make that
> configurable.
> 
> nd
> 
It is mentioned in the HTML spec:

---
HTML 4.01 Specification
W3C Recommendation 24 December 1999

http://www.w3.org/TR/1999/REC-html401-19991224/appendix/notes.html#h-B.2.2

The URI that is constructed when a form is submitted may be used as an 
anchor-style link (e.g., the href attribute for the A element). 
Unfortunately, the use of the "&" character to separate form fields 
interacts with its use in SGML attribute values to delimit character 
entity references. For example, to use the URI "http://host/?x=1&y=2" as 
a linking URI, it must be written <A href="http://host/?x=1&#38;y=2"> or 
<A href="http://host/?x=1&amp;y=2">.

We recommend that HTTP server implementors, and in particular, CGI 
implementors support the use of ";" in place of "&" to save authors the 
trouble of escaping "&" characters in this manner.
---
Another useful link:

http://www.ecos.de/~mailarc/embperl/2001-04/msg00060.html
---

So maybe we should conform to the spec and support both styles.




Re: Patch for query string customization?

Posted by André Malo <nd...@perlig.de>.
* "Brett E." <br...@fastclick.com> wrote:

> Sorry for the confusion. I meant is it possible to use a #define macro 
> for the query string delimiter. Ie, everywhere we use '?' in the code, 
> use say QUERY_STRING_DELIM. For example:
> 
> modules/mappers/mod_rewrite.c:
> 
>      q = strchr(r->filename, '?');
> 
> to
> 
>      q = strchr(r->filename, QUERY_STRING_DELIM);
> 
> ..everywhere in the code.

I think, no. The question mark as query string delimiter is well defined in
several RFCs. Since we implement HTTP, there's no reason to make that
configurable.

nd

Re: Patch for query string customization?

Posted by "Brett E." <br...@fastclick.com>.
Sorry for the confusion. I meant is it possible to use a #define macro 
for the query string delimiter. Ie, everywhere we use '?' in the code, 
use say QUERY_STRING_DELIM. For example:

modules/mappers/mod_rewrite.c:

     q = strchr(r->filename, '?');

to

     q = strchr(r->filename, QUERY_STRING_DELIM);

..everywhere in the code.

Thanks,

Brett

André Malo wrote:
> * "Brett E." <br...@fastclick.com> wrote:
> 
> 
>>Would the powers that be accept a patch which would define the query 
>>string as a macro, possibly specified in configure and with sane 
>>defaults of course?
> 
> 
> Sorry, I don't understand your idea. Can you explain it more? Thanks.
> 
> nd
> 



Re: Patch for query string customization?

Posted by André Malo <nd...@perlig.de>.
* "Brett E." <br...@fastclick.com> wrote:

> Would the powers that be accept a patch which would define the query 
> string as a macro, possibly specified in configure and with sane 
> defaults of course?

Sorry, I don't understand your idea. Can you explain it more? Thanks.

nd