You are viewing a plain text version of this content. The canonical link for it is here.
Posted to apreq-dev@httpd.apache.org by "T.J. Mather" <tj...@maxmind.com> on 2002/10/21 03:08:39 UTC

Microsoft Bug Work around

Hi,

I have included a patch that is a work around for (what I think may be) 
a bug in Microsoft's XMLHTTP method.  Basically Microsoft's code does not
set a Content-type when sending a POST request, so as a workaround,
I have set it to DEFAULT_ENCTYPE when Content-type is not set.

Thanks,
TJ

--- libapreq-1.0/c/apache_request.c     Mon Feb 18 11:48:27 2002
+++ libapreq-1.0_new/c/apache_request.c Sun Oct 20 21:05:26 2002
@@ -278,6 +278,11 @@

     if (r->method_number == M_POST) {
        const char *ct = ap_table_get(r->headers_in, "Content-type");
+       /* workaround for bug where Microsoft.XMLHTTP doesn't set a Content-type */
+       if (ct == NULL) {
+           ap_table_set(r->headers_in, "Content-type", DEFAULT_ENCTYPE);
+           ct = DEFAULT_ENCTYPE;
+       }
        if (ct && strncaseEQ(ct, DEFAULT_ENCTYPE, DEFAULT_ENCTYPE_LENGTH)) {
            result = ApacheRequest_parse_urlencoded(req);
        }


Re: Microsoft Bug Work around

Posted by "T.J. Mather" <tj...@maxmind.com>.
On 21 Oct 2002, Joe Schaefer wrote:

> "T.J. Mather" <tj...@maxmind.com> writes:
> 
> > I have included a patch that is a work around for (what I think may be) 
> > a bug in Microsoft's XMLHTTP method.  Basically Microsoft's code does not
> > set a Content-type when sending a POST request, so as a workaround,
> > I have set it to DEFAULT_ENCTYPE when Content-type is not set.
> 
> Are you certain this is a bug in Microsoft's XMLHTTP method?  The
> HOWTO on Microsoft's website:
> 
>   http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q290591&
> 
> basically says that clients must set the Content-Type header explicitly.

I stand corrected - a client told me that there was a bug in our web 
service, and I tracked it down to them not sending the Content-Type
when they made the request.  It now appears that it is a bug in their
code, not Microsoft's code - I'll forward the HOWTO on to them and see if 
it fixes their problem.

Thanks,
-TJ


Re: Microsoft Bug Work around

Posted by Joe Schaefer <jo...@sunstarsys.com>.
"T.J. Mather" <tj...@maxmind.com> writes:

> I have included a patch that is a work around for (what I think may be) 
> a bug in Microsoft's XMLHTTP method.  Basically Microsoft's code does not
> set a Content-type when sending a POST request, so as a workaround,
> I have set it to DEFAULT_ENCTYPE when Content-type is not set.

Are you certain this is a bug in Microsoft's XMLHTTP method?  The
HOWTO on Microsoft's website:

  http://support.microsoft.com/default.aspx?scid=KB;EN-US;Q290591&

basically says that clients must set the Content-Type header explicitly.

I'm reluctant to commit this patch as a workaround, without hard evidence 
of a bug in MS's software that prevents the client from POSTing this
header. 

OTOH, we *could* apply the patch as an act of DWIMery, but I won't 
do that without seeing more opinions from other apreq users.

-- 
Joe Schaefer