4 Replies Latest reply on Apr 26, 2002 5:35 AM by alepape

    HttpRequest content-type extra space ?

    alepape

      Wondering why the getContentType() method on the HttpRequest class was getting nothing but null in my environment (JBoss-2.4.4_Tomcat-4.0.1), I noticed that the HTTP header that should be "content-type" was in fact "content-type ".
      The extra space at the end is pretty much a problem, as you can see.
      Does anyone knows about this problem ? Am I the only one getting it ?

        • 1. Re: HttpRequest content-type extra space ?
          jwkaltz

          The http request you're seeing in your server was filled by your browser - so it looks to me like your browser is not doing proper http !?!
          What browser are you using ? Have you tried whether different browser give you the same effect ?

          • 2. Re: HttpRequest content-type extra space ?
            alepape

            Actually, it's not even a browser I use. It's one of our apps. But the important fact is that everything was working fine under Jboss JBoss-2.2.2_Tomcat-3.2.2 but now under JBoss-2.4.4_Tomcat-4.0.1, I've this problem. The way the header is build in our apps may be the problem though...

            Thanks

            • 3. Re: HttpRequest content-type extra space ?
              jwkaltz

              It is conceivable that Tomcat 3.2.2 did some additional transformation on the headers, such as remove blanks after the name, and that Tomcat 4.0.1 is less tolerant.

              In any case, if you want your application to be portable, you must comply to the http RFC when building your http request (rfc 2616). I think the required format is
              field-name: field-value
              so you could have spaces after the : separator, but not before.

              • 4. Re: HttpRequest content-type extra space ?
                alepape

                Exactly what I did... and it works fine

                Thanks again