diff options
author | Josh Rickmar <jrick@devio.us> | 2012-07-21 00:01:17 -0400 |
---|---|---|
committer | Josh Rickmar <jrick@devio.us> | 2012-07-21 00:01:17 -0400 |
commit | b330a3405982270819ab4df43675b09360d95cc8 (patch) | |
tree | d1fea8ce8718d9fc6a3f7910e1391d218c89ff2e | |
parent | 31f11a7ad4665240da2f3cd73315bfa7022aa08a (diff) | |
download | xombrero-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.
-rw-r--r-- | xombrero.c | 12 |
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 |