add nohead param to skip over the cache check with HEAD method

This commit is contained in:
Anthony Minessale 2012-10-05 10:14:22 -05:00
parent 44f78e9e76
commit 09b1b8bc7f

View File

@ -2530,6 +2530,7 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char
lock_file(context, SWITCH_TRUE); lock_file(context, SWITCH_TRUE);
if (!context->url_params || !switch_true(switch_event_get_header(context->url_params, "nohead"))) {
if ((status = fetch_cache_data(context, url, &headers, NULL)) != SWITCH_STATUS_SUCCESS) { if ((status = fetch_cache_data(context, url, &headers, NULL)) != SWITCH_STATUS_SUCCESS) {
if (status == SWITCH_STATUS_NOTFOUND) { if (status == SWITCH_STATUS_NOTFOUND) {
unreachable = 2; unreachable = 2;
@ -2561,6 +2562,9 @@ static switch_status_t locate_url_file(http_file_context_t *context, const char
} }
switch_event_destroy(&headers); switch_event_destroy(&headers);
}
fetch_cache_data(context, url, &headers, context->cache_file); fetch_cache_data(context, url, &headers, context->cache_file);
metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s", metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s",
url, url,