httpd-apreq-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stas Bekman <s...@stason.org>
Subject are there only M_POST and M_GET/HEAD?
Date Fri, 19 Apr 2002 09:02:21 GMT
in the main request parsing function, there is this logic:

     if (r->method_number == M_POST) {
	const char *ct = apr_table_get(r->headers_in, "Content-type");
	if (ct && strncaseEQ(ct, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
	    rc = ApacheRequest_parse_urlencoded(req);
	}
	else if (ct && strncaseEQ(ct, MULTIPART_ENCTYPE, MULTIPART_ENCTYPE_LENGTH)) {
	   rc = ApacheRequest_parse_multipart(req);
	}
	else {
	    ap_log_rerror(REQ_ERROR,
			  "[libapreq] unknown content-type: `%s'", ct);
	    rc = HTTP_INTERNAL_SERVER_ERROR;
	}
     }
     else {
	rc = ApacheRequest_parse_urlencoded(req);
     }

which means that if the method is not POST, it should be handled by
parse_urlencoded. Shouldn't this be:

elsif (... == M_GET || ==  M_HEAD)
    rc = ApacheRequest_parse_urlencoded(req);
else
   error

does Apache::Request have a defined behaviour for other methods then
GET, POST and HEAD?

Moreover ApacheRequest_parse_urlencoded does anything at all only if
the method is POST, so why do we call it? looks like a bad logic to
me.


__________________________________________________________________
Stas Bekman            JAm_pH ------> Just Another mod_perl Hacker
http://stason.org/     mod_perl Guide ---> http://perl.apache.org
mailto:stas@stason.org http://use.perl.org http://apacheweek.com
http://modperlbook.org http://apache.org   http://ticketmaster.com


Mime
View raw message