201 · Question #346
A virtual server is listening at 10.10.1.100:80 and has the following iRule associated with it: when HTTP_REQUEST { if { [HTTP::header UserAgent] contains "MSIE" } { pool MSIE_pool } else { pool…
The correct answer is B. Mozilla_pool. The iRule directs the request to a specific pool based on the 'User-Agent' HTTP header.
Question
A virtual server is listening at 10.10.1.100:80 and has the following iRule associated with it:
when HTTP_REQUEST { if { [HTTP::header UserAgent] contains "MSIE" } { pool MSIE_pool } else { pool Mozilla_pool } which pool will receive the request?
Options
- AMSIE_pool
- BMozilla_pool
- CNone. The request will be dropped.
- DUnknown. The pool cannot be determined from the information provided.
How the community answered
(63 responses)- A6% (4)
- B73% (46)
- C17% (11)
- D3% (2)
Why each option
The iRule directs the request to a specific pool based on the 'User-Agent' HTTP header.
The `MSIE_pool` would only be selected if the `User-Agent` header contained 'MSIE', which is not specified in the question.
The iRule's `if` condition checks if the `User-Agent` header *contains* 'MSIE'. Since no 'User-Agent' is provided in the question, this condition evaluates to false, causing the `else` block to execute and direct the request to the `Mozilla_pool`.
The iRule includes an `else` block that ensures a pool is always selected, preventing the request from being dropped due to an unhandled condition.
The iRule's logic is deterministic; without a specific 'User-Agent' header, the `if` condition is false, leading directly to the `else` block for pool selection.
Concept tested: iRule HTTP header evaluation and conditional logic
Source: https://clouddocs.f5.com/api/irules/HTTP__header.html
Topics
Community Discussion
No community discussion yet for this question.