Forum Discussion
Andreas_Lamprec
Nimbostratus
Nov 25, 2014ASM_REQUEST_DONE and HTTP/1.1 POST request with Expect: header
Hello!
Can somebody tell me how i could check if my iRule is running in the right "context" for checking HTTP::uri during a ASM_REQUEST_DONE event?
My problem is, that we receive HTTP/1.1 r...
Andreas_Lamprec
Nimbostratus
Nov 26, 2014Thanks for you answer!
So if i understood you right, then HTTP_REQUEST event will not be raised for the "second" part of the HTTP/1.1 Post request?
How about following code:
when HTTP_REQUEST {
if { [HTTP::header exists "Expect"] } {
set expect_flag 1
} else {
set expect_flag -1
}
}
when ASM_REQUEST_DONE {
if( expect_flag != 0 } {
do something to check if the request shall be unblocked
and set "shall_be_unblocked" to 1
unblocking of all "normal" requests
if { shall_be_unblocked == 1 && expect_flag < 0} { ASM::unblock }
unblocking of POST requests with Expect header set
if { shall_be_unblocked == 1 && expect_flag > 0 } { set expect_flag 0; ASM::unblock }
}
} This way, the actual POST request could be unblocked if nessesary, but the "second" part of the POST will not be handled by ASM_REQUEST_DONE
- Drew_128543Nov 26, 2014
Nimbostratus
My best guess at what is happening is that the ASM needs to see the entire POST for the ASM::unblock to work. By stripping the expect header, it forces the client to send the rest of the POST (after that ~3 second delay) before the ASM_REQUEST_DONE gets called. If you leave the Expect header in place, the ASM_REQUEST_DONE gets called before it has the entire post, so the HTTP::uri calls throw the context error, and the ASM::unblock fails to work. I am unsure how to get this work with leaving the Expect: 100-continue header in place (after I stripped the header out I had to move on to other tasks and was unable to continue testing).
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
DevCentral Quicklinks
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com
Discover DevCentral Connects