Jump to content

get the complete client's request headers


raven74

Recommended Posts

Is there any way of getting the complete client's request headers including the first line?

 

I want to ban users from sending TRACE, TRACK etc request headers to my site. I know this can be done in apache but I don't have permission to modify those files.

 

For example write in terminal:

telnet mysite.com 80

TRACE / HTTP/1.0

 

The above sends a TRACE header to the server that I would like to ban.

 

Can this be done with PHP?

Link to comment
Share on other sites

Is there any way of getting the complete client's request headers including the first line?

 

I want to ban users from sending TRACE, TRACK etc request headers to my site. I know this can be done in apache but I don't have permission to modify those files.

 

For example write in terminal:

telnet mysite.com 80

TRACE / HTTP/1.0

 

The above sends a TRACE header to the server that I would like to ban.

 

Can this be done with PHP?

 

You can easily do it through .htaccess file in the root.

 

Please read:

http://www.askapache.com/htaccess/apache-htaccess.html

http://corz.org/serv/tricks/htaccess2.php

 

Link to comment
Share on other sites

I use mod_rewrite for other things but it won't work for REQUEST_METHOD. I tried putting this code in the root of my site but it won't work.

 

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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.