From b330a3405982270819ab4df43675b09360d95cc8 Mon Sep 17 00:00:00 2001 From: Josh Rickmar Date: Sat, 21 Jul 2012 00:01:17 -0400 Subject: 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. --- xombrero.c | 12 ++++++------ 1 file 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 -- cgit 1.4.1-2-gfad0