aboutsummaryrefslogtreecommitdiff
path: root/src/main.rs
diff options
context:
space:
mode:
authorMartin Fischer <martin@push-f.com>2022-07-30 09:15:45 +0200
committerMartin Fischer <martin@push-f.com>2022-07-30 09:15:45 +0200
commit3dc92796c8674b9e8a1370797723ef1c327085b6 (patch)
treeaa0842c52420c07fea56c4c2a20bed2ce6d67a87 /src/main.rs
parente9532cfbf9b125db3e0d501da1b2d678713b55bb (diff)
set Referrer-Policy: same-origin for more privacy
Diffstat (limited to 'src/main.rs')
-rw-r--r--src/main.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/main.rs b/src/main.rs
index 73de77d..8005892 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -240,6 +240,10 @@ async fn service<C: Controller>(
.parse()
.unwrap()
});
+
+ // don't leak the hostname of the GitPad instance when following external links
+ resp.headers_mut()
+ .insert(header::REFERRER_POLICY, "same-origin".parse().unwrap());
resp
}