about summary refs log tree commit diff stats
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
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.
-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
27;' href='/akkartik/mu/commit/cpp/relayout?h=hlt&id=b1bbe92da37dd44df458ffa122e052612bb9eff3'>b1bbe92d ^
810542f1 ^
b1bbe92d ^










0864900c ^
b1bbe92d ^





b1bbe92d ^
0864900c ^


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65