diff options
author | Quentin Rameau <quinq@fifth.space> | 2017-05-18 12:33:28 +0200 |
---|---|---|
committer | Quentin Rameau <quinq@fifth.space> | 2017-05-22 12:38:49 +0200 |
commit | 2223417c91569f8314205d8f34c3cdf4d96d6e1a (patch) | |
tree | 80ff68618203dcc2677ebdcfa4eaee4eaef38b89 | |
parent | a1328457cff30dc678a1b8e80dc44ddb73ce293c (diff) | |
download | surf-2223417c91569f8314205d8f34c3cdf4d96d6e1a.tar.gz surf-2223417c91569f8314205d8f34c3cdf4d96d6e1a.tar.bz2 surf-2223417c91569f8314205d8f34c3cdf4d96d6e1a.zip |
Fix handling of uri-specific parameters
We need to (re)apply uri-specific parameters for each new uri even if
the parameter has already been set to get the correct value.
Thanks to Julien STEINHAUSER <julien.steinhauser@orange.fr> for the
report!
-rw-r--r-- | surf.c | 28 |
1 files changed, 19 insertions, 9 deletions
@@ -643,7 +643,7 @@ cookiepolicy_set(const WebKitCookieAcceptPolicy p) void seturiparameters(Client *c, const char *uri) { - Parameter *newconfig = NULL; + Parameter *config, *newconfig = NULL; int i; for (i = 0; i < LENGTH(uriparams); ++i) { @@ -656,16 +656,26 @@ seturiparameters(Client *c, const char *uri) if (!newconfig) newconfig = defconfig; - if (newconfig == curconfig) - return; for (i = 0; i < ParameterLast; ++i) { - if (defconfig[i].force) - continue; - if (newconfig[i].force) - setparameter(c, 0, i, &newconfig[i].val); - else if (curconfig[i].force) - setparameter(c, 0, i, &defconfig[i].val); + switch(i) { + case Certificate: + case CookiePolicies: + case Style: + config = defconfig[i].force ? defconfig : + newconfig[i].force ? newconfig : + defconfig; + break; + default: + if (newconfig == curconfig || defconfig[i].force) + continue; + config = newconfig[i].force ? newconfig : + curconfig[i].force ? defconfig : + NULL; + } + + if (config) + setparameter(c, 0, i, &config[i].val); } curconfig = newconfig; |