summaryrefslogtreecommitdiff
path: root/libfetch/http.c
diff options
context:
space:
mode:
authorTimo Teräs <timo.teras@iki.fi>2018-01-03 10:01:08 +0200
committerTimo Teräs <timo.teras@iki.fi>2018-01-03 14:25:07 +0200
commitf90af35e9c563bd4f865d8d47a7ae357191494db (patch)
treedf5a1b22db24ea4cdd9970a027192d23b0b3e675 /libfetch/http.c
parente0eff8742f342c2c23e1d7ee081f3afd08cb5169 (diff)
downloadapk-tools-f90af35e9c563bd4f865d8d47a7ae357191494db.tar.gz
apk-tools-f90af35e9c563bd4f865d8d47a7ae357191494db.tar.bz2
apk-tools-f90af35e9c563bd4f865d8d47a7ae357191494db.tar.xz
apk-tools-f90af35e9c563bd4f865d8d47a7ae357191494db.zip
libfetch: add option to set "Cache-Control: no-cache"
ref #8161
Diffstat (limited to 'libfetch/http.c')
-rw-r--r--libfetch/http.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/libfetch/http.c b/libfetch/http.c
index d66fcc6..638c9a8 100644
--- a/libfetch/http.c
+++ b/libfetch/http.c
@@ -836,7 +836,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
{
conn_t *conn;
struct url *url, *new;
- int chunked, direct, if_modified_since, need_auth, noredirect;
+ int chunked, direct, if_modified_since, need_auth, noredirect, nocache;
int keep_alive, verbose, cached;
int e, i, n, val;
off_t offset, clength, length, size;
@@ -848,6 +848,7 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
direct = CHECK_FLAG('d');
noredirect = CHECK_FLAG('A');
+ nocache = CHECK_FLAG('C');
verbose = CHECK_FLAG('v');
if_modified_since = CHECK_FLAG('i');
keep_alive = 0;
@@ -917,6 +918,8 @@ http_request(struct url *URL, const char *op, struct url_stat *us,
op, url->doc);
}
+ if (nocache)
+ http_cmd(conn, "Cache-Control: no-cache\r\n");
if (if_modified_since && url->last_modified > 0)
set_if_modified_since(conn, url->last_modified);