summaryrefslogtreecommitdiff
path: root/src/warc.c
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:17 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2021-03-05 10:08:17 +0900
commit6403e0986cb5d0b8b4cbea66f8f3ff7a68cb4c20 (patch)
tree4936775a0caecb157d619aa6c8f26310c2611c7e /src/warc.c
parent0fd98397eab07f1ec3b1fad9890fd751298e1fe0 (diff)
downloadwget-6403e0986cb5d0b8b4cbea66f8f3ff7a68cb4c20.tar.gz
wget-6403e0986cb5d0b8b4cbea66f8f3ff7a68cb4c20.tar.bz2
wget-6403e0986cb5d0b8b4cbea66f8f3ff7a68cb4c20.zip
Imported Upstream version 1.18upstream/1.18
Diffstat (limited to 'src/warc.c')
-rw-r--r--src/warc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/warc.c b/src/warc.c
index ea3ad11..bc1aafa 100644
--- a/src/warc.c
+++ b/src/warc.c
@@ -246,6 +246,22 @@ warc_write_header (const char *name, const char *value)
return warc_write_ok;
}
+/* Writes a WARC header with a URI as value to the current WARC record.
+ This method may be run after warc_write_start_record and
+ before warc_write_block_from_file. */
+static bool
+warc_write_header_uri (const char *name, const char *value)
+{
+ if (value)
+ {
+ warc_write_string (name);
+ warc_write_string (": <");
+ warc_write_string (value);
+ warc_write_string (">\r\n");
+ }
+ return warc_write_ok;
+}
+
/* Copies the contents of DATA_IN to the WARC record.
Adds a Content-Length header to the WARC record.
Run this method after warc_write_header,
@@ -1292,7 +1308,7 @@ warc_write_request_record (const char *url, const char *timestamp_str,
{
warc_write_start_record ();
warc_write_header ("WARC-Type", "request");
- warc_write_header ("WARC-Target-URI", url);
+ warc_write_header_uri ("WARC-Target-URI", url);
warc_write_header ("Content-Type", "application/http;msgtype=request");
warc_write_date_header (timestamp_str);
warc_write_header ("WARC-Record-ID", record_uuid);