| 117 | #define METHOD_IDEMPOTENT_WITH_ARGS 2 |
| 118 | |
| 119 | static int is_idempotent(request_rec *r) |
| 120 | { |
| 121 | /* |
| 122 | * RFC2616 (9.1.2): GET, HEAD, PUT, DELETE, OPTIONS, TRACE are considered |
| 123 | * idempotent. Hint: HEAD requests use M_GET as method number as well. |
| 124 | */ |
| 125 | switch (r->method_number) { |
| 126 | case M_GET: |
| 127 | case M_DELETE: |
| 128 | case M_PUT: |
| 129 | case M_OPTIONS: |
| 130 | case M_TRACE: |
| 131 | /* |
| 132 | * If the request has arguments it might have side-effects and thus |
| 133 | * it might be undesirable to resend it to a backend again |
| 134 | * automatically. |
| 135 | */ |
| 136 | if (r->args) { |
| 137 | return METHOD_IDEMPOTENT_WITH_ARGS; |
| 138 | } |
| 139 | return METHOD_IDEMPOTENT; |
| 140 | /* Everything else is not considered idempotent. */ |
| 141 | default: |
| 142 | return METHOD_NON_IDEMPOTENT; |
| 143 | } |
| 144 | } |
| 145 | |
| 146 | static apr_off_t get_content_length(request_rec * r) |
| 147 | { |
no outgoing calls
no test coverage detected