guile-user
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Guile web server example serving static files


From: Zelphir Kaltstahl
Subject: Guile web server example serving static files
Date: Thu, 17 Sep 2020 23:45:07 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Icedove/68.10.0

Hello Guile Users!

I finally managed to create an example for using Guile's web server and
serving static files. A rather silly bug kept me for a few days from
making progress, but finally today I fixed it.

I tried to implement some security checks about the path of the
requested static assets. If anyone wants to look at it and point out
issues with it, I will try to fix it, or you could make a pull request.
If there are any other issues, it would also be great to know them : )

Here is the code in my repository:

https://notabug.org/ZelphirKaltstahl/guile-examples/src/65ba7cead2983f1ceb8aa2d4eedfe37734e5ca56/web-development/example-03-serve-static-assets

I tried to comment most stuff, so that the code can be understood more
easily.

And here is a pointer to the path security stuff:

https://notabug.org/ZelphirKaltstahl/guile-examples/src/65ba7cead2983f1ceb8aa2d4eedfe37734e5ca56/web-development/example-03-serve-static-assets/web-path-handling.scm#L50

(Perhaps I overlooked something fundamental with regard to safe path
handling?)

So I guess I can soon start developing another example, perhaps already
a blog, which makes use of all the code : )

I have not yet made use of Guile's sendfile procedure and keyboard
interrupt is not yet caught.

Regards,
Zelphir

-- 
repositories: https://notabug.org/ZelphirKaltstahl




reply via email to

[Prev in Thread] Current Thread [Next in Thread]