]> gitweb.ps.run Git - ps-cgit/blobdiff - ui-shared.c
about: always ensure page has a trailing slash
[ps-cgit] / ui-shared.c
index e755c92d79878a292f165cfcad23d66c6a6d8bcc..4f84b7c60e8570331353961497f1df7db340c106 100644 (file)
@@ -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("<link rel='vcs-git' href='");