From 5e8ff5958852358cbf512c92c808341a5e90fef2 Mon Sep 17 00:00:00 2001 From: "Pierre R. Mai" Date: Mon, 9 Oct 2000 22:53:46 +0000 Subject: [PATCH] Adjusted `standard-response-body' to take the server as an additional parameter. This is part of an ongoing drive to restructure standard message generation to be more modular. Still lots to be done... --- src/main/responses.cl | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/main/responses.cl b/src/main/responses.cl index 61d4351..592e7f8 100644 --- a/src/main/responses.cl +++ b/src/main/responses.cl @@ -24,22 +24,24 @@ (make-instance 'string-entity :content-type "text/html" :body - (apply #'standard-response-body status-code args)) + (apply #'standard-response-body + (http-message-server request) + status-code args)) args)) -(defgeneric standard-response-body (status-code &rest args)) +(defgeneric standard-response-body (server status-code &rest args)) -(defmethod standard-response-body (status-code &rest args) - (declare (ignore args)) - (format nil "~%~%~3D ~A~%~%~%

~:*~A

~%~%" +(defmethod standard-response-body (server status-code &rest args) + (declare (ignore server args)) + (format nil "~%~%~3D ~A~%~%~%

~2:*~3D ~A

~%~%" status-code (HTTP-Code-Description status-code))) (defmethod standard-response-body - ((status-code (eql +HTTP-Code-Moved-Temporarily+)) &rest args - &key location) - (declare (ignore args)) - (format nil "~%~%~3D ~A~%~%~%

~:*~A

~%

The new location is ~:*~A.

~%~%" + (server (status-code (eql +HTTP-Code-Moved-Temporarily+)) &rest args + &key location) + (declare (ignore server args)) + (format nil "~%~%~3D ~A~%~%~%

~2:*~3D ~A

~%

The new location is ~:*~A.

~%~%" status-code (HTTP-Code-Description status-code) location))