Download Firefox: WindowsMac OS X
logo       
Google Custom Search
    AddThis Social Bookmark Button

Re: Header function: msg#00004

Subject: Re: Header function
>>>>> On Thu, 13 Jan 2005 12:50:18 +0000, David Johnson-Davies 
>>>>> <david@xxxxxxxxxxxxxxx> said:

  David> Can anyone help with the following query?

  David> I want to discover when a URL is called with a HEAD method. I've tried
  David> supplying a header-function argument to export-url with the following:

  David> (export-url "/test.html"
  David>     :computed
  David>     :response-function #'serve-page
  David>     :header-function #'(lambda (url) (print "HEAD call") :html)
  David>     :public t)

  David> This gives the error:

  David> Error: Arguments don't match lambda list..

  David> Any suggestions welcomed.

It is usually a good idea to say which version of which software you are
using!

In CL-HTTP 70.190 at least, it looks like a bug -- try changing this
definition in server/url.lisp:

(defmethod initialize-specialization ((url http-computed-url) class init-args)
  (with-class-change-for-initialize-specialization (url class init-args)
    (destructuring-bind (response-function &optional header-function) init-args
      (setf (response-function url) response-function
            (header-function url) header-function)
      url)))

to read:

(defmethod initialize-specialization ((url http-computed-url) class init-args)
  (with-class-change-for-initialize-specialization (url class init-args)
    (destructuring-bind (response-function . header-function) init-args
      (setf (response-function url) response-function
            (header-function url) header-function)
      url)))

i.e. destructuring a cons instead of using &OPTIONAL.  I think
HTTP-COMPUTED-FORM and HTTP-CLIENT-SCRIPT have the same problem.

__Martin

_______________________________________________
WWW-CL mailing list
WWW-CL@xxxxxxxxxxxxxxxxxxx
http://lists.csail.mit.edu/mailman/listinfo/www-cl



<Prev in Thread] Current Thread [Next in Thread>