From d7034806a4b1279f62d606501f831dcad31798e6 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Wed, 12 Aug 2015 14:50:09 +0200 Subject: about: always ensure page has a trailing slash Otherwise we can't easily embed links to other /about/ pages. Signed-off-by: Jason A. Donenfeld --- ui-shared.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'ui-shared.c') diff --git a/ui-shared.c b/ui-shared.c index e755c92..4f84b7c 100644 --- a/ui-shared.c +++ b/ui-shared.c @@ -689,6 +689,14 @@ void cgit_print_http_headers(void) exit(0); } +void cgit_redirect(const char *url, bool permanent) +{ + htmlf("Status: %d %s\n", permanent ? 301 : 302, permanent ? "Moved" : "Found"); + htmlf("Location: %s\n", url); + htmlf("\n"); + exit(0); +} + static void print_rel_vcs_link(const char *url) { html("