http://weitz.de/files/hunchentoot-beta.tar.gz
Use at your own risk, as usual.
FYI, I'm currently re-factoring the code (and changing parts of the API while I'm at it). I do this with LispWorks on Windows 99% of the time, so I'm not even sure if the code still compiles on SBCL or other Lisps. I'm happy if you send me notes about problems you're encountering.
And, sorry, the documentation still hasn't been updated.
Cheers, Edi.
Edi Weitz wrote:
http://weitz.de/files/hunchentoot-beta.tar.gz
Use at your own risk, as usual.
FYI, I'm currently re-factoring the code (and changing parts of the API while I'm at it). I do this with LispWorks on Windows 99% of the time, so I'm not even sure if the code still compiles on SBCL or other Lisps. I'm happy if you send me notes about problems you're encountering.
Initial indications look good on SBCL.
One note about test.lisp:
The output from the LATIN-1 / UTF-8 tests is being escaped twice, once by ESC in INFO-TABLE and once by ESCAPE-STRING-ALL in PARAMETER-TEST.
Cheers,
-- Travis
diff -rN -u old-hunchentoot/test/test.lisp new-hunchentoot/test/test.lisp --- old-hunchentoot/test/test.lisp 2006-10-08 22:34:41.000000000 -0400 +++ new-hunchentoot/test/test.lisp 2006-10-08 22:34:41.000000000 -0400 @@ -236,10 +236,10 @@ (case method (:get (info-table (query-string) (map 'list #'char-code (get-parameter "foo")) - (escape-string-all (get-parameter "foo")))) + (get-parameter "foo"))) (:post (info-table (raw-post-data) (map 'list #'char-code (post-parameter "foo")) - (escape-string-all (post-parameter "foo"))))))))) + (post-parameter "foo"))))))))
(defun parameter-test-latin1-get () (parameter-test :method :get :charset :iso-8859-1))
On Sun, 08 Oct 2006 22:37:21 -0400, Travis Cross travis@travislists.com wrote:
The output from the LATIN-1 / UTF-8 tests is being escaped twice, once by ESC in INFO-TABLE and once by ESCAPE-STRING-ALL in PARAMETER-TEST.
Thanks. Fixed in my local CVS tree.
Edi Weitz wrote:
FYI, I'm currently re-factoring the code (and changing parts of the API while I'm at it).
Here is a small API change that's been sitting in my queue for awhile:
REDIRECT currently builds a full URL out of the script name, the host, and one of two hard-coded protocols. This is useful when you are redirecting to another HTTP/S URL on your site.
Often, however, I have cases where I already know the full URL, either because the user has given it too me, or because I have it stored in a database. It seems wasteful and hazardous to break the URL apart only to put it back together again. Also, there are times when I need to redirect to protocols other than http:// or https:// (such as ftp:// or even sip://).
Therefore I propose that a lower level function be slid underneath REDIRECT and exported. I've tentatively called this REDIRECT-URL.
Cheers,
-- Travis
Sun Oct 8 23:02:53 EDT 2006 Travis Cross tc@traviscross.com * Added exported function REDIRECT-URL. diff -rN -u old-hunchentoot/modlisp.lisp new-hunchentoot/modlisp.lisp --- old-hunchentoot/modlisp.lisp 2006-10-08 23:04:56.000000000 -0400 +++ new-hunchentoot/modlisp.lisp 2006-10-08 23:04:56.000000000 -0400 @@ -210,6 +210,20 @@ (rfc-1123-date)) (values))
+(defun redirect-url (url &key add-session-id permanently) + "Redirects the browser to the resource URL. Adds a session ID if +ADD-SESSION-ID is true. If PERMANENTLY is true, a 301 request is +sent to the browser, otherwise a 302." + (when add-session-id + (setq url (add-cookie-value-to-url url :replace-ampersands-p nil))) + (setf (header-out "Location") + url + (return-code *reply*) + (if permanently + +http-moved-permanently+ + +http-moved-temporarily+)) + (throw 'handler-done nil)) + (defun redirect (script-name &key (host (host *request*) host-provided-p) (protocol (if (ssl-session-id *request*) @@ -227,15 +241,9 @@ ((:http) "http") ((:https) "https")) host script-name))) - (when add-session-id - (setq url (add-cookie-value-to-url url :replace-ampersands-p nil))) - (setf (header-out "Location") - url - (return-code *reply*) - (if permanently - +http-moved-permanently+ - +http-moved-temporarily+)) - (throw 'handler-done nil))) + (redirect-url url + :add-session-id add-session-id + :permanently permanently)))
(defun require-authorization (&optional (realm "Hunchentoot")) (setf (header-out "WWW-Authenticate") diff -rN -u old-hunchentoot/packages.lisp new-hunchentoot/packages.lisp --- old-hunchentoot/packages.lisp 2006-10-08 23:04:56.000000000 -0400 +++ new-hunchentoot/packages.lisp 2006-10-08 23:04:56.000000000 -0400 @@ -174,6 +174,7 @@ :raw-post-data :real-remote-addr :recompute-request-parameters + :redirect-url :redirect :referer :remote-addr
On Sun, 08 Oct 2006 23:34:05 -0400, Travis Cross travis@travislists.com wrote:
Here is a small API change that's been sitting in my queue for awhile:
Yeah, makes sense. I'll add something like that to the release.
Edi Weitz wrote:
And, sorry, the documentation still hasn't been updated.
Hi Edi,
I'm have been learning cl in my spare time for the past few months, and I'm trying to build a small webapp in cl just to see how difficult/easy it would be from other web frameworks I use for regular work. I recently started playing with Hunchentoot, and I have to say it works great (I use it with relatively old sbcl 0.9.8 - default on Ubuntu), and installation was easy, even for a relative newbie (after I followed the list).
If installation is not too much of a hassle for you, I think a wiki for documentation would help immensely, I and others who are interested can put in some steps that other newcomers might miss (or comments, etc). If you're so inclined, would like to help you with this in anyway I can.
Thanks, Vamsee.
Hi Vamsee,
On Mon, 09 Oct 2006 12:26:14 +0530, Vamsee Kanakala vamlists@gmail.com wrote:
I'm have been learning cl in my spare time for the past few months, and I'm trying to build a small webapp in cl just to see how difficult/easy it would be from other web frameworks I use for regular work. I recently started playing with Hunchentoot, and I have to say it works great (I use it with relatively old sbcl 0.9.8
- default on Ubuntu), and installation was easy, even for a relative
newbie (after I followed the list).
Great!
If installation is not too much of a hassle for you, I think a wiki for documentation would help immensely, I and others who are interested can put in some steps that other newcomers might miss (or comments, etc). If you're so inclined, would like to help you with this in anyway I can.
I think that's a good idea, but due to my workload I wouldn't want to install and maintain a Wiki on one of my machines. I think there are already enough other Wikis that you could use for this task, though. One of them would be the CL Gardeners Wiki, or maybe CLiki. Also, Google will show you a lot of interesting links if you search for "free wiki".
http://wiki.alu.org/Gardeners_Projects http://www.cliki.net/index http://www.google.com/search?q=free+wiki
If you set something up, let us know and I'll link to it from the Hunchentoot website.
Cheers, Edi.