diff options
| author | Jason A. Donenfeld | 2015-08-12 14:50:09 +0200 |
|---|---|---|
| committer | Jason A. Donenfeld | 2015-08-12 15:03:32 +0200 |
| commit | d7034806a4b1279f62d606501f831dcad31798e6 (patch) | |
| tree | 1aafe109f0598dcb3b32dda27173031893e5956a /ui-shared.c | |
| parent | 13c2d3df0440ce04273de3149631a9bd97490c6e (diff) | |
| download | cgit-d7034806a4b1279f62d606501f831dcad31798e6.tar.gz cgit-d7034806a4b1279f62d606501f831dcad31798e6.tar.bz2 cgit-d7034806a4b1279f62d606501f831dcad31798e6.zip | |
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 <Jason@zx2c4.com>
Diffstat (limited to 'ui-shared.c')
| -rw-r--r-- | ui-shared.c | 8 |
1 files changed, 8 insertions, 0 deletions
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) | |||
| 689 | exit(0); | 689 | exit(0); |
| 690 | } | 690 | } |
| 691 | 691 | ||
| 692 | void cgit_redirect(const char *url, bool permanent) | ||
| 693 | { | ||
| 694 | htmlf("Status: %d %s\n", permanent ? 301 : 302, permanent ? "Moved" : "Found"); | ||
| 695 | htmlf("Location: %s\n", url); | ||
| 696 | htmlf("\n"); | ||
| 697 | exit(0); | ||
| 698 | } | ||
| 699 | |||
| 692 | static void print_rel_vcs_link(const char *url) | 700 | static void print_rel_vcs_link(const char *url) |
| 693 | { | 701 | { |
| 694 | html("<link rel='vcs-git' href='"); | 702 | html("<link rel='vcs-git' href='"); |
