[Bese-devel] Bug in aserve backend for redirect component

Antonio Menezes Leitao aml at gia.ist.utl.pt
Sat Jul 9 11:16:18 UTC 2005


Hi,

Once again, aserve macros (this time with-http-response) require more
information at macro expansion time than they should.  This affects
UCW's redirect-component as it attempts to set the Status header to
"302" but aserve doesn't use it because the macro expansion requires
that information as an explicit :response parameter with corresponding
argument given by, e.g., *response-moved-permanently*,
*response-found*, etc.  The function code-to-response returns the
appropriate value for a given status.

I replaced the method 

(defmethod shutdown ((response aserve-response))
  (net.aserve:with-http-response ((request response) (entity response))
    (net.aserve:with-http-body ((request response) (entity response))
      (write-string (get-output-stream-string (html-stream response)) 
		    net.aserve::*html-stream*))))

with 

(defmethod shutdown ((response aserve-response))
  (net.aserve:with-http-response ((request response) (entity response)
				  :response (if (get-header response "Status")
					      (net.aserve::code-to-response
					       (parse-integer
						(get-header response "Status")))
					      nil))
    (net.aserve:with-http-body ((request response) (entity response))
      (write-string (get-output-stream-string (html-stream response)) 
		    net.aserve::*html-stream*))))

and it now works OK. But it looks ugly :-(


Best regards,

António Leitão.



More information about the bese-devel mailing list