mirror of
https://github.com/jambonz/jambonz-infrastructure.git
synced 2025-12-19 08:57:43 +00:00
* initial changes for proxmox support * proxmox packer updates * terraform template for Proxmox jambonz-mini * update jambonz-mini to 0.8.3-3
56 lines
2.1 KiB
Diff
56 lines
2.1 KiB
Diff
--- mod_httapi.c 2023-03-01 13:57:28
|
|
+++ mod_httapi.c.new 2023-03-01 14:19:34
|
|
@@ -2472,6 +2472,12 @@
|
|
char *ua = NULL;
|
|
const char *profile_name = NULL;
|
|
int tries = 10;
|
|
+ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL &&
|
|
+ strstr(url, "X-Amz-Algorithm") != NULL &&
|
|
+ strstr(url, "X-Amz-Credential") != NULL &&
|
|
+ strstr(url, "X-Amz-Date") != NULL &&
|
|
+ strstr(url, "X-Amz-Expires") != NULL &&
|
|
+ strstr(url, "X-Amz-SignedHeaders") != NULL;
|
|
|
|
if (context->url_params) {
|
|
profile_name = switch_event_get_header(context->url_params, "profile_name");
|
|
@@ -2614,7 +2620,7 @@
|
|
switch_curl_easy_setopt(curl_handle, CURLOPT_WRITEDATA, (void *) client);
|
|
} else {
|
|
switch_curl_easy_setopt(curl_handle, CURLOPT_HEADER, 1);
|
|
- switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1);
|
|
+ if (!awsSignedUrl) switch_curl_easy_setopt(curl_handle, CURLOPT_NOBODY, 1);
|
|
}
|
|
|
|
if (headers) {
|
|
@@ -2783,6 +2789,12 @@
|
|
char *metadata;
|
|
const char *ext = NULL;
|
|
const char *err_msg = NULL;
|
|
+ int awsSignedUrl = strstr(url, "X-Amz-Signature") != NULL &&
|
|
+ strstr(url, "X-Amz-Algorithm") != NULL &&
|
|
+ strstr(url, "X-Amz-Credential") != NULL &&
|
|
+ strstr(url, "X-Amz-Date") != NULL &&
|
|
+ strstr(url, "X-Amz-Expires") != NULL &&
|
|
+ strstr(url, "X-Amz-SignedHeaders") != NULL;
|
|
|
|
load_cache_data(context, url);
|
|
|
|
@@ -2831,7 +2843,7 @@
|
|
|
|
if (!unreachable && !zstr(context->metadata)) {
|
|
metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s",
|
|
- url,
|
|
+ awsSignedUrl ? context->cache_file : url,
|
|
switch_event_get_header_nil(headers, "last-modified"),
|
|
switch_event_get_header_nil(headers, "etag"),
|
|
switch_event_get_header_nil(headers, "content-length"),
|
|
@@ -2855,7 +2867,7 @@
|
|
|
|
|
|
metadata = switch_core_sprintf(context->pool, "%s:%s:%s:%s:%s",
|
|
- url,
|
|
+ awsSignedUrl ? context->cache_file : url,
|
|
switch_event_get_header_nil(headers, "last-modified"),
|
|
switch_event_get_header_nil(headers, "etag"),
|
|
switch_event_get_header_nil(headers, "content-length"),
|