Return-Path: Delivered-To: apmail-tomcat-users-archive@www.apache.org Received: (qmail 95308 invoked from network); 7 Feb 2009 12:35:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 7 Feb 2009 12:35:20 -0000 Received: (qmail 3217 invoked by uid 500); 7 Feb 2009 12:35:07 -0000 Delivered-To: apmail-tomcat-users-archive@tomcat.apache.org Received: (qmail 3189 invoked by uid 500); 7 Feb 2009 12:35:07 -0000 Mailing-List: contact users-help@tomcat.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: "Tomcat Users List" Delivered-To: mailing list users@tomcat.apache.org Received: (qmail 3177 invoked by uid 99); 7 Feb 2009 12:35:07 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Feb 2009 04:35:07 -0800 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of aw@ice-sa.com designates 212.85.38.174 as permitted sender) Received: from [212.85.38.174] (HELO popeye.combios.es) (212.85.38.174) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 07 Feb 2009 12:34:57 +0000 Received: from [192.168.245.129] (p549EBB17.dip0.t-ipconnect.de [84.158.187.23]) (authenticated bits=0) by popeye.combios.es (8.13.8/8.13.8/Debian-3) with ESMTP id n17CYWhm004321 for ; Sat, 7 Feb 2009 13:34:35 +0100 Message-ID: <498D7ECF.1010801@ice-sa.com> Date: Sat, 07 Feb 2009 13:30:07 +0100 From: =?UTF-8?B?QW5kcsOpIFdhcm5pZXI=?= User-Agent: Thunderbird 2.0.0.16 (Windows/20080708) MIME-Version: 1.0 To: Tomcat Users List Subject: Re: TC6 ${CATALINA_HOME}/conf/web.xml Is this the place to constrain the mime type? References: <711a73df0902050939s40d13915lc539ddc7ebe09753@mail.gmail.com> <0AAE5AB84B013E45A7B61CB66943C17215B611AB00@USEA-EXCH7.na.uis.unisys.com> <27AEFA85-6D12-4A4F-801F-9D92B707EFD5@koberg.com> <711a73df0902051059w6813ae6q8a8d655f8be0ae12@mail.gmail.com> <0AAE5AB84B013E45A7B61CB66943C17215B611AE7A@USEA-EXCH7.na.uis.unisys.com> <711a73df0902060239s1317c7a0vdb120f28cc97ebfb@mail.gmail.com> <0AAE5AB84B013E45A7B61CB66943C17215B614F974@USEA-EXCH7.na.uis.unisys.com> <711a73df0902060624h53f9bbf8vf79e76ad1fd46e26@mail.gmail.com> <498C870D.4040001@ice-sa.com> <711a73df0902062311y6949632avc353e97e670e62c4@mail.gmail.com> In-Reply-To: <711a73df0902062311y6949632avc353e97e670e62c4@mail.gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV 0.92.1/8962/Sat Feb 7 06:01:51 2009 on popeye.combios.es X-Virus-Status: Clean X-Virus-Checked: Checked by ClamAV on apache.org Dave Pawson wrote: > Rob, Christopher, Andre. > Thanks for the input. > As I said to Rob, security is not an issue at the present time. > There is no value in the content returned by the 'server' / end point; > I'm not trying to make it secure. Just respond less than > I otherwise might. > Ok, then let me make one final guess and suggestion. If the point is just for your server application to avoid wasting time sending a response to a client that is not "yours", and which would not be able to do something useful with it anyway, then the easiest route would probably still be a simple "servlet filter". That servlet filter would examine the request headers (say the "User-Agent" header, which your client would set appropriately), determine if it is or not the appropriate client, and if not send an appropriate HTTP 4xx error response right away, without even letting the request go to the servlet or restlet or whatever. By sending the correct 4xx kind of response, you would let this "client" know right away, without a doubt, that there is no content here for him, and that he should not even retry, thus avoiding further waste of time for everyone. Google for "HTTP response codes" to find the most appropriate response in your case. You may even find a ready-made servlet filter that could do that (and many other things besides) here : http://www.tuckey.org/urlrewrite/ A servlet filter does not modify (or require you to modify) the application in any way; it just sees the request before your application does, and can do something to it before the application sees it; it also sees the response of your application after it is produced and can do something to it before it is passed to the client. Also, servlet filters are an entirely portable mechanism, defined in the Servlet Specification, so this would work on any servlet engine. Note again that the above is not in any way a security mechanism, because any client can send whatever User-Agent header it very well pleases. But it would be a very HTTP RFC-compliant way of kindly asking inappropriate clients to just go away and not come back. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscribe@tomcat.apache.org For additional commands, e-mail: users-help@tomcat.apache.org