unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Zelphir Kaltstahl <zelphirkaltstahl@posteo.de>
To: Guile User <guile-user@gnu.org>
Subject: Guile web server example serving static files
Date: Thu, 17 Sep 2020 23:45:07 +0200	[thread overview]
Message-ID: <04e63ab3-93b7-a0fe-6db8-34f00e6098e0@posteo.de> (raw)

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	other threads:[~2020-09-17 21:45 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 21:45 Zelphir Kaltstahl [this message]
2020-09-18  5:56 ` Guile web server example serving static files divoplade
2020-09-19 10:39   ` Zelphir Kaltstahl
2020-09-20  7:48   ` tomas
2020-09-20  7:52     ` divoplade
2020-09-20  8:29       ` tomas
2020-09-20  8:54         ` divoplade
2020-09-20  9:07           ` tomas
2020-09-18  7:47 ` Dr. Arne Babenhauserheide
2020-09-19 10:57   ` Zelphir Kaltstahl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=04e63ab3-93b7-a0fe-6db8-34f00e6098e0@posteo.de \
    --to=zelphirkaltstahl@posteo.de \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).