30 Jan 20:38
4 Feb 07:35
Re: directory listing in hop?
<Manuel.Serrano <at> inria.fr>
2012-02-04 06:35:23 GMT
2012-02-04 06:35:23 GMT
Hi Sven,
> Which function in hop is called when hop automatically lists
> the contents of a directory on a hop server?
The function directory->response is in charge of returning a directory list.
It is defined in runtime/http_response.scm.
This can be overridden using a local hook. In the ~/.config/hop/hoprc.hop file
you may add something such as:
(hop-http-response-local-hook-add!
(lambda (req::http-request resp)
(if (directory? req.abspath)
... do whatever you want ...
resp)))
Cheers,
--
--
Manuel
4 Feb 16:47
Re: directory listing in hop?
Sven Hartrumpf <hartrumpf <at> gmx.net>
2012-02-04 15:47:28 GMT
2012-02-04 15:47:28 GMT
Hi Manuel. Sat, 4 Feb 2012 07:35:23 +0100, Manuel.Serrano wrote: >> Which function in hop is called when hop automatically lists >> the contents of a directory on a hop server? > The function directory->response is in charge of returning a directory list. Thanks for the information. > This can be overridden using a local hook. In the ~/.config/hop/hoprc.hop file > you may add something such as: I do not want to overwrite the definition; I wanted to report two bugs and make your life easier by adding fixes for them. Bug 1: The href for a directory occurring in the currently listed directory (by directory->response) is missing the trailing /. Patch for hop attached. Bug 2: The href for an entry shown by directory-response contains a double / if the calling function includes a trailing slash for the argument. This happens when browsing a hop directory tree. Patch for bigloo attached (a generalization of make-file-name). Ciao Sven(Continue reading)
6 Feb 15:52
Re: directory listing in hop?
<Manuel.Serrano <at> inria.fr>
2012-02-06 14:52:27 GMT
2012-02-06 14:52:27 GMT
> I do not want to overwrite the definition; I wanted > to report two bugs and make your life easier by > adding fixes for them. Wonderful! Both patch applied. Thanks a lot. -- -- Manuel
RSS Feed