You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Issac Goldstand <ma...@beamartyr.net> on 2003/01/15 00:07:13 UTC

[users@httpd] spoofing 200 responses

Once upon a time (about a month ago), I wrote a nice little Apache-2 module
which added a few lines of text into a response (output filter) and had a
little extra goodie which somehow checked for an imminent 404 and rewrote
the response so that a 200 would be sent instead with the two inserted
lines.  Time has passed and my source code is somehow lost, and I find
myself unable to do the trick again (although I recall it having seemed so
trivial then).  Anyone do something like this (and actually remember how?)

Thanks,
  Issac


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] Konqueror and Apache - 406

Posted by Dirk-Willem van Gulik <di...@webweaving.org>.

On Wed, 15 Jan 2003, Kees Hoekzema wrote:

> GET /ext/i/1032119313.gif HTTP/1.1
> Host: www.tweakers.net
> Connection: Keep-Alive
> User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)
> Accept: image/x-krl, image/x-portable-bitmap, image/x-xbm, image/x-ico,
> image/png, image/x-portable-pixmap, image/jpeg, image/x-xpm, image/x-eps,
> image/tiff, image/x-bmp, image/gif
>
> HTTP/1.1 406 Not Acceptable
> Date: Wed, 15 Jan 2003 01:04:53 GMT
> Server: Apache/1.3.27 (Unix) PHP/4.2.3 mod_gzip/1.3.19.1a
> Alternates: {"i.dsp" 1 {type application/x-httpd-php} {length 4248}}
> Connection: close
> Content-Type: text/html; charset=iso-8859-1
>
>
> When I remove the Accept: header from the GET request, it works fine. But
> Knoqueror uses it automaticly, resulting in missing images in Konqueror.

You do not show us the config; but I suspect that "type
application/x-httpd-php" may be a hint as to what the issue is. You
somewhere have assigned/get assigned the wrong mime type.

Dw


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


[users@httpd] Konqueror and Apache - 406

Posted by Kees Hoekzema <ke...@tweakers.net>.
Hello list,

I have some strange things going on with Apache and konqueror.
At our website we use multiviews, including for some image scripts.

But when a client uses konqueror it goes wrong:
Below is a telnet session to the server, with the headers Konqueror uses to
GET the image

GET /ext/i/1032119313.gif HTTP/1.1
Host: www.tweakers.net
Connection: Keep-Alive
User-Agent: Mozilla/5.0 (compatible; Konqueror/3.1; Linux)
Accept: image/x-krl, image/x-portable-bitmap, image/x-xbm, image/x-ico,
image/png, image/x-portable-pixmap, image/jpeg, image/x-xpm, image/x-eps,
image/tiff, image/x-bmp, image/gif

HTTP/1.1 406 Not Acceptable
Date: Wed, 15 Jan 2003 01:04:53 GMT
Server: Apache/1.3.27 (Unix) PHP/4.2.3 mod_gzip/1.3.19.1a
Alternates: {"i.dsp" 1 {type application/x-httpd-php} {length 4248}}
Connection: close
Content-Type: text/html; charset=iso-8859-1


When I remove the Accept: header from the GET request, it works fine. But
Knoqueror uses it automaticly, resulting in missing images in Konqueror.

What is the deal with this? Is it konqueror? or apache who doesn't
understand a normal request?

-kees


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] spoofing 200 responses

Posted by Issac Goldstand <ma...@beamartyr.net>.
Well, the idea is to set the output handler on a <Location> block.  If
there's any content piped through, the filter just injects the data.  If
not, however, it should rewrite the 404 to a 200 and spit out the data...
An ErrorDocument will work, I suppose, but it needs more configuration...

  Issac

----- Original Message -----
From: "Razvan Costea-Barlutiu" <cb...@laitek.com>
To: <us...@httpd.apache.org>
Sent: Wednesday, January 15, 2003 4:25 PM
Subject: Re: [users@httpd] spoofing 200 responses


>
> Maybe you really want to do this with modules, but wouldn't the
> ErrorDocument... /file from http.conf be of any help?
>
> --Razvan
>
>
> At 01:07 15-01-03 +0200, you wrote:
> >Once upon a time (about a month ago), I wrote a nice little Apache-2
module
> >which added a few lines of text into a response (output filter) and had a
> >little extra goodie which somehow checked for an imminent 404 and rewrote
> >the response so that a 200 would be sent instead with the two inserted
> >lines.  Time has passed and my source code is somehow lost, and I find
> >myself unable to do the trick again (although I recall it having seemed
so
> >trivial then).  Anyone do something like this (and actually remember
how?)
>
>
>
> ---------------------------------------------------------------------
> The official User-To-User support forum of the Apache HTTP Server Project.
> See <URL:http://httpd.apache.org/userslist.html> for more info.
> To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
>    "   from the digest: users-digest-unsubscribe@httpd.apache.org
> For additional commands, e-mail: users-help@httpd.apache.org
>


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] spoofing 200 responses

Posted by Razvan Costea-Barlutiu <cb...@laitek.com>.
Maybe you really want to do this with modules, but wouldn't the 
ErrorDocument... /file from http.conf be of any help?

--Razvan


At 01:07 15-01-03 +0200, you wrote:
>Once upon a time (about a month ago), I wrote a nice little Apache-2 module
>which added a few lines of text into a response (output filter) and had a
>little extra goodie which somehow checked for an imminent 404 and rewrote
>the response so that a 200 would be sent instead with the two inserted
>lines.  Time has passed and my source code is somehow lost, and I find
>myself unable to do the trick again (although I recall it having seemed so
>trivial then).  Anyone do something like this (and actually remember how?)



---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org