Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

I want to drop connection when Apache server receive HEAD-request

405 views
Skip to first unread message

Victor Lazarchuk

unread,
Aug 9, 2003, 1:43:27 AM8/9/03
to
Hello, All!
I want to drop connection when Apache server
receive HEAD-request .
It is possible ?
If it is possible how could i do this ?


With best regards, Victor Lazarchuk. E-mail: laz...@ukrpost.net


Jeffrey Grace

unread,
Aug 11, 2003, 4:51:42 AM8/11/03
to
I am not aware of this being possible in Apache. You can certainly use
<LIMIT> to restrict usage of HTTP methods, or use a RewriteRule based on
REQUEST_METHOD to give a 403 Forbidden response. But there is no way to
selectively drop the connection without a response.

I would also have to question the wisdom of simply dropping the
connection, as this would mean your server does not follow the RFC. You
should instead respond with a 403 Forbidden or 406 Not Acceptable, or if
you wanted to be vague, 500 Internal Server Error. (Use mod_security
for the last two).

Klaus Johannes Rusch

unread,
Aug 11, 2003, 6:05:29 AM8/11/03
to Victor Lazarchuk
Victor Lazarchuk wrote:

> I want to drop connection when Apache server
> receive HEAD-request .
> It is possible ?
> If it is possible how could i do this ?

Not sure what you mean by "drop connection", if you want to drop the
connection after serving the HEAD request, use
SetEnvIf Request_Method "HEAD" nokeepalive

If you want to disallow HEAD requests, you can do so with access control
directives (although disabling HEAD is generally not a good idea).

--
Klaus Johannes Rusch
Klaus...@atmedia.net
http://www.atmedia.net/KlausRusch/


Joachim Ring

unread,
Aug 11, 2003, 6:43:18 AM8/11/03
to
> I want to drop connection when Apache server
> receive HEAD-request .

what exactly do you want to do? if serving an error message and close
connection after that is ok, it could probably be reached with
something like:

<Limit HEAD>
SetEnv force-response-1.0 downgrade-1.0 nokeepalive
</Limit>

RewriteEngine On
RewriteCond %{REQUEST_METHOD} HEAD
RewriteRule .* - [F]

just closing down the connection without an answer doesn't comply with
rfcs and would need a special handler...

joachim

0 new messages