vADC Forum

Reply
Occasional Contributor
Posts: 12
Registered: ‎11-30-2012
Accepted Solution

Check XML post

Hi all, How do I use trafficscript to ensure that a post is only sent to the pool if the http header is an XML?

Brocadian
Posts: 101
Registered: ‎04-22-2015

Re: Check XML post

[ Edited ]

You could use something like this to test whether a POST command is XML, based on the content type:

 

if( http.getmethod() == "POST" ) {
   if( http.getheader( "Content-Type" ) != "text/xml" ) {
      connection.close( "403 XML content only, may be POSTed\r\n" );
   }
}

 Does that work for your application?

 

Join the Community

Get quick and easy access to valuable resource designed to help you manage your Brocade Network.