[racket] What controls the web-server continuation URL?

From: Norman Gray (norman at astro.gla.ac.uk)
Date: Mon Jan 17 19:01:09 EST 2011

Jay, hello.

On 2011 Jan 17, at 15:23, Jay McCarthy wrote:

> If from within a servlet, you want to adjust the URL, you can just
> copy the ids from the url produced by send/* and change the base.
> Here's a little example:
> #lang racket
> (require rackunit
>         web-server/servlet/web
>         net/url)
> (require/expose web-server/servlet/web (embed-ids))
> (define (copy-ks old-u new-u)
>  (embed-ids (continuation-url? (string->url old-u)) (string->url new-u)))
> (copy-ks (embed-ids (list 1 2 3) (string->url "http://localhost/user"))
>         "http://localhost/podcasting/user")

Thanks for this -- I felt sure there must be a way, and I'm reassured that it's not _completely_ obvious!

I realise, however, that I don't understand the way the web server works deeply enough to feel comfortable deploying this right now (I've gone for a rather messy pro-tem solution using high ports but limited to on-campus access), but this is probably the prompt I need to get myself a fuller understanding of the server's continuing clevernesses.

Best wishes,


Norman Gray  :  http://nxg.me.uk
Dept Physics and Astronomy, University of Glasgow, UK

Posted on the users mailing list.