Hello list,
first, to Edi: thanks for such a nice library!
I just stumbled across an error in the http-request function:
DRAKMA-USER <- (http-request "http://www.zeit.de" :method :trace)
Don't know how to handle method :TRACE. [Condition of type SIMPLE-ERROR]
Restarts: 0: [ABORT-REQUEST] Abort handling SLIME request. 1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {AC7D291}>)
triggered by this code in request.lisp:
(unless (member method '(:get :head :post :put) :test #'eq) (error "Don't know how to handle method ~S." method))
shouldn't the library allow all methods from HTTP/1.1?
Changing the code into:
(unless (member method '(:get :head :post :put :delete :options :trace) :test #'eq) (error "Don't know how to handle method ~S." method))
fixes this bugglet. BTW, it might be a good idea to add the methods needed for WebDAV as well -- at least there seems to be no reason for not adding them. Some of them would need to be added to case dispatch on method that sets the request contents (request.lisp, line 344 ff.).
One more remark about the 'OPTIONS' method. The standard introduces a 'magic' request URI to query server options (as opposed to options for a particular resource) - the request line should look like this:
OPTIONS * HTTP/1.1 Host: my.cool.server
I couldn't find a way to have puri:parse-uri generate a uri whose uri-path is "*" so i modified http-request to accept an method :options* (see attached patch).
Cheers, Ralf Mattes
Hi Ralf!
On Wed, 06 Sep 2006 16:41:35 +0200, Ralf Mattes rm@seid-online.de wrote:
first, to Edi: thanks for such a nice library!
You're welcome... :)
I just stumbled across an error in the http-request function:
DRAKMA-USER <- (http-request "http://www.zeit.de" :method :trace)
Don't know how to handle method :TRACE. [Condition of type SIMPLE-ERROR]
Restarts: 0: [ABORT-REQUEST] Abort handling SLIME request. 1: [TERMINATE-THREAD] Terminate this thread (#<THREAD "repl-thread" {AC7D291}>)
triggered by this code in request.lisp:
(unless (member method '(:get :head :post :put) :test #'eq) (error "Don't know how to handle method ~S." method))
shouldn't the library allow all methods from HTTP/1.1?
It's OK with me, I just didn't need them until now.
Changing the code into:
(unless (member method '(:get :head :post :put :delete :options :trace) :test #'eq) (error "Don't know how to handle method ~S." method))
fixes this bugglet. BTW, it might be a good idea to add the methods needed for WebDAV as well -- at least there seems to be no reason for not adding them. Some of them would need to be added to case dispatch on method that sets the request contents (request.lisp, line 344 ff.).
One more remark about the 'OPTIONS' method. The standard introduces a 'magic' request URI to query server options (as opposed to options for a particular resource) - the request line should look like this:
OPTIONS * HTTP/1.1 Host: my.cool.server
I couldn't find a way to have puri:parse-uri generate a uri whose uri-path is "*" so i modified http-request to accept an method :options* (see attached patch).
The patch is OK as far as I can see, but as with 99% of the patches I get, the patch for the doc strings and the documentation is missing. Adding half a dozen lines of code is the easy part... :)
I'll add that if I find the time, but probably not today.
Thanks, Edi.
On Wed, 06 Sep 2006 16:41:35 +0200, Ralf Mattes rm@seid-online.de wrote:
shouldn't the library allow all methods from HTTP/1.1? [...] BTW, it might be a good idea to add the methods needed for WebDAV as well
OK, done. There's a new release 0.4.1 online. Please test.
Cheers, Edi.
On Wed, 06 Sep 2006 16:41:35 +0200, Ralf Mattes rm@seid-online.de wrote:
;; create a 'magic' options request
(when (eq method :options*)
(setf (uri-path uri) "*"
(uri-query uri) ""
method :options))
Woops, that was wrong. The query part must be set to NIL, not "". See release 0.4.2.
Sorry, Edi.