Error code = 51 (not found) and redirection is now 30 following specifications Appendix https://gemini.circumlunar.space/docs/specification.html
This commit is contained in:
parent
d8a49b1827
commit
b2ccab7448
2 changed files with 4 additions and 4 deletions
4
main.c
4
main.c
|
@ -178,7 +178,7 @@ display_file(const char *path, const char *lang)
|
||||||
return;
|
return;
|
||||||
err:
|
err:
|
||||||
/* return an error code and no content */
|
/* return an error code and no content */
|
||||||
status(40, "text/gemini", lang);
|
status(51, "text/gemini", lang);
|
||||||
syslog(LOG_DAEMON, "path invalid %s", path);
|
syslog(LOG_DAEMON, "path invalid %s", path);
|
||||||
goto closefd;
|
goto closefd;
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ redirect:
|
||||||
goto err;
|
goto err;
|
||||||
}
|
}
|
||||||
|
|
||||||
status_redirect(39, target);
|
status_redirect(30, target);
|
||||||
syslog(LOG_DAEMON, "redirection from %s to %s", path, target);
|
syslog(LOG_DAEMON, "redirection from %s to %s", path, target);
|
||||||
|
|
||||||
closefd:
|
closefd:
|
||||||
|
|
|
@ -36,7 +36,7 @@ if ! [ $OUT = "649a2e224632b679fd7599eafb13c001" ] ; then echo "error" ; exit 1
|
||||||
|
|
||||||
# redirect file
|
# redirect file
|
||||||
OUT=$(printf "gemini://perso.pw/old_location\r\n" | ../vger -d var/gemini/ | tee /dev/stderr | $MD5)
|
OUT=$(printf "gemini://perso.pw/old_location\r\n" | ../vger -d var/gemini/ | tee /dev/stderr | $MD5)
|
||||||
if ! [ $OUT = "28262311ea814e6a481fa365894cfc3f" ] ; then echo "error" ; exit 1 ; fi
|
if ! [ $OUT = "cb4597b6fcc82cbc366ac9002fb60dac" ] ; then echo "error" ; exit 1 ; fi
|
||||||
|
|
||||||
# file from local directory using virtualhosts
|
# file from local directory using virtualhosts
|
||||||
OUT=$(printf "gemini://perso.pw/index.gmi\r\n" | ../vger -v -d var/gemini/ | tee /dev/stderr | $MD5)
|
OUT=$(printf "gemini://perso.pw/index.gmi\r\n" | ../vger -v -d var/gemini/ | tee /dev/stderr | $MD5)
|
||||||
|
@ -89,7 +89,7 @@ then
|
||||||
|
|
||||||
# file from /var/gemini/blog
|
# file from /var/gemini/blog
|
||||||
OUT=$(printf "gemini://host.name/blog\r\n" | ../vger | tee /dev/stderr | $MD5)
|
OUT=$(printf "gemini://host.name/blog\r\n" | ../vger | tee /dev/stderr | $MD5)
|
||||||
if ! [ $OUT = "f78c481e1614f1713e077b89aba5ab94" ] ; then echo "error" ; exit 1 ; fi
|
if ! [ $OUT = "ae3ce9fb5191a08a2c1f3e36b2985a01" ] ; then echo "error" ; exit 1 ; fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue