Hi Alex,

On 23-05-13 12:22 , Alexander Burger wrote:
Hi Jon,

href="doc/ref.html">ref.html</a>, but in the browser that was
expanded to the double-doc
"http://demo-project.jkleiser.c9.io/doc/doc/ref.html";. On c9.io I
sure. Can you suggest a fix for my "default" script that will make
it work in both contexts?
Hm, this sounds as if the browser is using a different "<base href="
tag. The PicoLisp server generates one, but it contains only the
protocol (http or https), hostname and port. No path names whatsoever.
So I have no idea at the moment.

We'll see ...

One more question:
Since in my web.l I use ...
(allowed ("doc/") "lib.css" "@lib/form.js" "favicon.ico" "!foo" "README")
.. I get a "404 Not Found" if I try to go to
"http://demo-project.jkleiser.c9.io/doc"; (with no "/" at the end).
Can I modify my "allowed" to allow "doc" without the "/" at the end?
Yes, just omit the "/". Everything in the list argument to 'allowed' is
allowed if it starts with those characters (i.e. is matched with
'pre?'). You just must be sure that there is no file or directory
starting with "doc" which should not be allowed.

Another way (perhaps better) would be to include "doc" in the normal
(exact) arguments to 'allowed' (and also keep "doc/" in the list). This
allows direct requests to both "doc/" and "doc", but not "docxxx".

♪♫ Alex

I tried the "better" way ...
(allowed ("doc/") "doc" "@lib.css" "@lib/form.js" "favicon.ico" "!foo" "README")

.. and it works, except now I get the "opposite URL problem". When I go to "http://demo-project.jkleiser.c9.io/doc";, the URLs in the list have lost their "doc/" component, like in this one: http://demo-project.jkleiser.c9.io/ref.html. The Path in the page header, however, is the same as before ("Index of doc/"). Is it possible for my "default" script to access any info about the HTTP request from my web server (web.l)?

UNSUBSCRIBE: mailto:picolisp@software-lab.de?subject=Unsubscribe

Reply via email to