summaryrefslogtreecommitdiff
path: root/src/warc.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:20 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:20 +0900
commitafd456999b076e5e6505dd5ca6942a5e7471c70c (patch)
tree9ee11bda8c1d6ada1938b0324ed01a2d99e99178 /src/warc.c
parent429760a22c7e2ff8a2de69744b04aa4b2f202119 (diff)
downloadwget-afd456999b076e5e6505dd5ca6942a5e7471c70c.tar.gz
wget-afd456999b076e5e6505dd5ca6942a5e7471c70c.tar.bz2
wget-afd456999b076e5e6505dd5ca6942a5e7471c70c.zip
Imported Upstream version 1.19.2upstream/1.19.2
Diffstat (limited to 'src/warc.c')
-rw-r--r--src/warc.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/warc.c b/src/warc.c
index bc1aafa..6a4b9eb 100644
--- a/src/warc.c
+++ b/src/warc.c
@@ -32,6 +32,7 @@ as that of the covered work. */
#include "utils.h"
#include "version.h"
#include "dirname.h"
+#include "url.h"
#include <stdio.h>
#include <stdlib.h>
@@ -1365,6 +1366,8 @@ warc_write_cdx_record (const char *url, const char *timestamp_str,
mime_type = "-";
if (redirect_location == NULL || strlen(redirect_location) == 0)
redirect_location = "-";
+ else
+ redirect_location = url_escape(redirect_location);
number_to_string (offset_string, offset);
@@ -1413,7 +1416,7 @@ warc_write_revisit_record (const char *url, const char *timestamp_str,
warc_write_header ("WARC-Refers-To", refers_to);
warc_write_header ("WARC-Profile", "http://netpreserve.org/warc/1.0/revisit/identical-payload-digest");
warc_write_header ("WARC-Truncated", "length");
- warc_write_header ("WARC-Target-URI", url);
+ warc_write_header_uri ("WARC-Target-URI", url);
warc_write_date_header (timestamp_str);
warc_write_ip_header (ip);
warc_write_header ("Content-Type", "application/http;msgtype=response");
@@ -1505,7 +1508,7 @@ warc_write_response_record (const char *url, const char *timestamp_str,
warc_write_header ("WARC-Record-ID", response_uuid);
warc_write_header ("WARC-Warcinfo-ID", warc_current_warcinfo_uuid_str);
warc_write_header ("WARC-Concurrent-To", concurrent_to_uuid);
- warc_write_header ("WARC-Target-URI", url);
+ warc_write_header_uri ("WARC-Target-URI", url);
warc_write_date_header (timestamp_str);
warc_write_ip_header (ip);
warc_write_header ("WARC-Block-Digest", block_digest);
@@ -1562,7 +1565,7 @@ warc_write_record (const char *record_type, const char *resource_uuid,
warc_write_header ("WARC-Record-ID", resource_uuid);
warc_write_header ("WARC-Warcinfo-ID", warc_current_warcinfo_uuid_str);
warc_write_header ("WARC-Concurrent-To", concurrent_to_uuid);
- warc_write_header ("WARC-Target-URI", url);
+ warc_write_header_uri ("WARC-Target-URI", url);
warc_write_date_header (timestamp_str);
warc_write_ip_header (ip);
warc_write_digest_headers (body, payload_offset);