Sometimes clients will give us no Accept info at all; this routine sets * up the standard default for that case, and also arranges for us to be * willing to run a CGI script if we find one. (In fact, we set up to * dramatically prefer CGI scripts in cases where that's appropriate, * e.g., POST or when URI includes query args or extra path info). */
| 701 | * e.g., POST or when URI includes query args or extra path info). |
| 702 | */ |
| 703 | static void maybe_add_default_accepts(negotiation_state *neg, |
| 704 | int prefer_scripts) |
| 705 | { |
| 706 | accept_rec *new_accept; |
| 707 | |
| 708 | if (!neg->accepts) { |
| 709 | neg->accepts = apr_array_make(neg->pool, 4, sizeof(accept_rec)); |
| 710 | |
| 711 | new_accept = (accept_rec *) apr_array_push(neg->accepts); |
| 712 | |
| 713 | new_accept->name = "*/*"; |
| 714 | new_accept->quality = 1.0f; |
| 715 | new_accept->level = 0.0f; |
| 716 | } |
| 717 | |
| 718 | new_accept = (accept_rec *) apr_array_push(neg->accepts); |
| 719 | |
| 720 | new_accept->name = CGI_MAGIC_TYPE; |
| 721 | if (neg->use_rvsa) { |
| 722 | new_accept->quality = 0; |
| 723 | } |
| 724 | else { |
| 725 | new_accept->quality = prefer_scripts ? 2.0f : 0.001f; |
| 726 | } |
| 727 | new_accept->level = 0.0f; |
| 728 | } |
| 729 | |
| 730 | /***************************************************************** |
| 731 | * |