Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Under some circunstances Cherokee 1.2.101 generated configuration

files in which the 'Max Age' propert of a HSTS entry could hold a
non-numeric value. This patch enhances the configuration file
migration tool to detect and fix such situation.
  • Loading branch information...
commit 51e2ff195b3e1a32671481cbaa77834982e3a2c8 1 parent 99044fc
@alobbs alobbs authored
Showing with 14 additions and 0 deletions.
  1. +14 −0 admin/config_version.py
View
14 admin/config_version.py
@@ -72,6 +72,16 @@ def upgrade_to_1_0_13 (cfg):
del(cfg[key])
+# Converts from 1.0.13 to 1.2.102
+def upgrade_to_1_2_102 (cfg):
+ # Fix HSTS entries with the value "One year".
+ # Eg: vserver!1!hsts!max_age = One year
+ for v in cfg.keys('vserver'):
+ max_age_val = cfg.get_val ('vserver!%s!hsts!max_age'%(v))
+ if max_age_val and not max_age_val.isdigit():
+ cfg['vserver!%s!hsts!max_age'%(v)] = "31536000"
+
+
def config_version_get_current():
ver = configured.VERSION.split ('b')[0]
v1,v2,v3 = ver.split (".")
@@ -145,5 +155,9 @@ def config_version_update_cfg (cfg):
if ver_config_i < 1000013:
upgrade_to_1_0_13 (cfg)
+ # Update to.. 1.2.102
+ if ver_config_i < 1200102:
+ upgrade_to_1_2_102 (cfg)
+
cfg["config!version"] = ver_release_s
return True
Please sign in to comment.
Something went wrong with that request. Please try again.