Forum Discussion
JoeK_10405
Jan 16, 2009Nimbostratus
Updated iRule per CharlesCS suggestion:
when HTTP_REQUEST {
if {[HTTP::method] equals "OPTIONS" } {
log local0. "OPTIONS method detected"
if {[HTTP::uri] equals "/xxx/authentication/AuthenticationServlet"} {
log local0. "uri equals /xxx/authentication/AuthenticationServlet!"
if {[HTTP::version] eq "1.1" } {
log local0. "intercept response !"
HTTP::respond 200 "Allow" "GET, HEAD, POST, TRACE, OPTIONS"
}
}
}
}
And following CURL output:
curl -v -X OPTIONS http://xxx/xxx/authentication/AuthenticationServlet
* About to connect() to xxx port 80
* Trying 10.0.0.26... connected
* Connected to xxx (10.0.0.26) port 80
> OPTIONS /xxx/authentication/AuthenticationServlet HTTP/1.1
> User-Agent: curl/7.15.3 (i686-redhat-linux-gnu) libcurl/7.15.3 OpenSSL/0.9.7l zlib/1.1.4
> Host: xxx
> Accept: */*
>
< HTTP/1.0 200 OK
< Allow: GET, HEAD, POST, TRACE, OPTIONS
< Server: BigIP
* HTTP/1.0 connection set to keep alive!
< Connection: Keep-Alive
< Content-Length: 0
* Connection 0 to host xxx left intact
* Closing connection 0