You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Mark J Cox <ma...@ukweb.com> on 1996/07/18 09:25:33 UTC

Content-type "image/gif;qs=0.5" breaks browsers.

Will sending a Content-type of "image/gif;qs=0.5" break older browsers?

The HTTP/1.0 spec says that sending a Content-type with attached
parameters is legal but "Some older HTTP applications do not recognize
media type parameters. HTTP/1.0 applications should only use media type
parameters when they are necessary"

HTTP/1.1 draft says "When sending data to older HTTP applications,
implementations should only use media type parameters when they are
required by that type/subtype definition. "

A quick straw poll revealed:

	Ignored parameters
		Any version of Netscape on Unix/PC
		Compuserve Browser/Spry Mosaic 4
		Lynx

	Failed
		Microsoft Internet Explorer [PC, even version 3.0b1!]
		NSCA Mosiac 2.0 [PC] ("Undefined mime type")
		Netmanage Webserver 5 ("Unknown file type")

Should we strip any parameters from the content-type before we return
it to the browser?

Mark

---
Escape character is '^]'.
HEAD /icons/image HTTP/1.0
Accept: */*

HTTP/1.0 200 OK
Date: Thu, 18 Jul 1996 07:45:06 GMT
Server: Apache/1.1.0
Content-Type: image/jpeg;qs=0.9
Set-Cookie: Apache=www1334837675925273; path=/
Last-Modified: Thu, 18 Jul 1996 07:44:34 GMT
ETag: "2f58-621-31edeb62"
Accept-Ranges: bytes
Content-Length: 1569
Vary: Accept

--


Re: Content-type "image/gif;qs=0.5" breaks browsers.

Posted by Alexei Kosut <ak...@organic.com>.
On Fri, 19 Jul 1996 rasmus@madhaus.utcs.utoronto.ca wrote:

> RFC-1867 File Uploads set the Mime boundary as a parameter in the
> content type field as well.  I use file uploads extensively to distribute
> software and would hate to see that broken.
> 
> Then again, that is only for stuff going to the other way (browser->server)
> so perhaps this isn't relevant to this discussion at all.

No, it's relavent. There are lots of occasions to send multipart media
types browser->server. HTTP/1.1's multipart/byteranges is one, for
example. And they all need boundary paramaters.

-- Alexei Kosut <ak...@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/


Re: Content-type "image/gif;qs=0.5" breaks browsers.

Posted by ra...@madhaus.utcs.utoronto.ca.
> On Fri, 19 Jul 1996, Mark J Cox wrote:
> 
> > Heres a patch that strips all mime type paramaters unless someone
> > _really_ wants to send them.  I can't think of any situations that need
> > the subtype definition so I'll submit this on Monday if I see no
> > objections. 
> 
> I'm with Roy. This is a Bad Idea. There are very good reasons to have
> paramaters on content types (charset, for example). This is not a good
> reason to strip them all off.
> 
> A better idea might be to simply make a "DefaultQuality image/gif 0.5"
> directive. Shouldn't be that hard. (look at where it sets the quality for
> CGI scripts - put it in there).

RFC-1867 File Uploads set the Mime boundary as a parameter in the
content type field as well.  I use file uploads extensively to distribute
software and would hate to see that broken.

Then again, that is only for stuff going to the other way (browser->server)
so perhaps this isn't relevant to this discussion at all.

-Rasmus

Re: Content-type "image/gif;qs=0.5" breaks browsers.

Posted by Alexei Kosut <ak...@organic.com>.
On Fri, 19 Jul 1996, Mark J Cox wrote:

> Heres a patch that strips all mime type paramaters unless someone _really_
> wants to send them.  I can't think of any situations that need the
> subtype definition so I'll submit this on Monday if I see no objections.

I'm with Roy. This is a Bad Idea. There are very good reasons to have
paramaters on content types (charset, for example). This is not a good
reason to strip them all off.

A better idea might be to simply make a "DefaultQuality image/gif 0.5"
directive. Shouldn't be that hard. (look at where it sets the quality for
CGI scripts - put it in there).

-- Alexei Kosut <ak...@organic.com>            The Apache HTTP Server 
   http://www.nueva.pvt.k12.ca.us/~akosut/      http://www.apache.org/


Re: Content-type "image/gif;qs=0.5" breaks browsers.

Posted by Mark J Cox <ma...@ukweb.com>.
> Will sending a Content-type of "image/gif;qs=0.5" break older browsers?
>
> HTTP/1.1 draft says "implementations should only use media type parameters
> when they are required by that type/subtype definition. "

Heres a patch that strips all mime type paramaters unless someone _really_
wants to send them.  I can't think of any situations that need the
subtype definition so I'll submit this on Monday if I see no objections.

Mark

*** http_protocol.c     Wed Jul 17 09:29:35 1996
--- http_protocol.c.new Fri Jul 19 10:35:05 1996
***************
*** 660,670 ****

  char *nuke_mime_parms (pool *p, char *content_type)
  {
!     /* How marvelous.  Arena doesn't *accept* "text/html; level=3"
!      * as a MIME type, so we have to strip off the parms.
       */

! #ifndef ARENA_BUG_WORKAROUND
      return content_type;
  #else

--- 660,671 ----

  char *nuke_mime_parms (pool *p, char *content_type)
  {
!     /* How marvelous.  Arena and many other browsers don't *accept*
!      * "text/html; level=3" as a MIME type, so we have to strip off the parms.
!      * Lets remove them all unless someone really wants them
       */

! #ifdef DONT_NUKE_MIME_PARMS
      return content_type;
  #else