diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-15 10:17:29 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-03-15 10:17:29 +0000 |
commit | 7f62257df910dabf75acbc931ba339de0abde743 (patch) | |
tree | 095d82d829b86866f6d5eda286d66fb446b50561 /man.cgi.3 | |
parent | 1868a0d4224f0f94adf4fa7d103cf10e2020f5ea (diff) | |
download | mandoc-7f62257df910dabf75acbc931ba339de0abde743.tar.gz |
It's annoying that people keep writing URIs including redundant parts
like "/OpenBSD-current/manN/". To discourage that, let man.cgi(8)
redirect search form results to nice, concise URIs.
Diffstat (limited to 'man.cgi.3')
-rw-r--r-- | man.cgi.3 | 20 |
1 files changed, 19 insertions, 1 deletions
@@ -126,12 +126,30 @@ contains a search query in short format or when is empty and a .Ev QUERY_STRING is provided. -It changes into the manpath and calls +If possible, requests using +.Ev QUERY_STRING +are redirected to URIs using +.Ev PATH_INFO +by calling +.Fn pg_redirect . +Otherwise, it changes into the manpath and calls .Xr mansearch 3 . Depending on the result, it calls either .Fn pg_noresult or .Fn pg_searchres . +.It Ft void Fn pg_redirect "const struct req *req" "const char *name" +This function is special in so far as it does not print an HTML page, +but only an HTTP 303 response with a Location: of the form: +.Sm off +.No http:// +.Ar host Ns / +.Op Ar scriptname Ns / +.Op Ar manpath Ns / +.Op Ar arch Ns / +.Fa name +.Op Pf . Ar sec +.Sm on .It Ft void Fn pg_noresult "const struct req *req" "const char *msg" This function calls .Fn resp_begin_html , |