about summary refs log tree commit diff stats
path: root/xombrero.c
diff options
context:
space:
mode:
authorJosh Rickmar <jrick@devio.us>2012-07-21 00:01:17 -0400
committerJosh Rickmar <jrick@devio.us>2012-07-21 00:01:17 -0400
commitb330a3405982270819ab4df43675b09360d95cc8 (patch)
treed1fea8ce8718d9fc6a3f7910e1391d218c89ff2e /xombrero.c
parent31f11a7ad4665240da2f3cd73315bfa7022aa08a (diff)
downloadxombrero-b330a3405982270819ab4df43675b09360d95cc8.tar.gz
Always add the callback function to the soup message to enable HSTS if
enable_strict_transport is set.  Before, if referer_mode was set to
XT_REFERER_ALWAYS, this code would never be run.  Found by dhill.
Diffstat (limited to 'xombrero.c')
-rw-r--r--xombrero.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/xombrero.c b/xombrero.c
index d3555fa..c84dd88 100644
--- a/xombrero.c
+++ b/xombrero.c
@@ -4770,6 +4770,12 @@ session_rq_cb(SoupSession *s, SoupMessage *msg, SoupSocket *socket,
 	if (s == NULL || msg == NULL)
 		return;
 
+	if (enable_strict_transport) {
+		soup_message_add_header_handler(msg, "finished",
+		    "Strict-Transport-Security",
+		    G_CALLBACK(strict_transport_security_cb), NULL);
+	}
+
 	if (referer_mode == XT_REFERER_ALWAYS)
 		return;
 
@@ -4820,12 +4826,6 @@ session_rq_cb(SoupSession *s, SoupMessage *msg, SoupSocket *socket,
 			break;
 		}
 	}
-
-	if (enable_strict_transport) {
-		soup_message_add_header_handler(msg, "finished",
-		    "Strict-Transport-Security",
-		    G_CALLBACK(strict_transport_security_cb), NULL);
-	}
 }
 
 int