Obtain the Request-URI from the original request-line, returning * a new string from the request pool containing the URI or "". */
| 374 | * a new string from the request pool containing the URI or "". |
| 375 | */ |
| 376 | static char *original_uri(request_rec *r) |
| 377 | { |
| 378 | char *first, *last; |
| 379 | |
| 380 | if (r->the_request == NULL) { |
| 381 | return (char *) apr_pcalloc(r->pool, 1); |
| 382 | } |
| 383 | |
| 384 | first = r->the_request; /* use the request-line */ |
| 385 | |
| 386 | while (*first && !apr_isspace(*first)) { |
| 387 | ++first; /* skip over the method */ |
| 388 | } |
| 389 | while (apr_isspace(*first)) { |
| 390 | ++first; /* and the space(s) */ |
| 391 | } |
| 392 | |
| 393 | last = first; |
| 394 | while (*last && !apr_isspace(*last)) { |
| 395 | ++last; /* end at next whitespace */ |
| 396 | } |
| 397 | |
| 398 | return apr_pstrmemdup(r->pool, first, last - first); |
| 399 | } |
| 400 | |
| 401 | AP_DECLARE(void) ap_add_cgi_vars(request_rec *r) |
| 402 | { |