# File lib_core/rucy/document.rb, line 339
    def publish(script_name, request, response, logger)
      logger.debug("[#{Time.now.httpdate}] enter document: #{self.class}")
      case (request.method)
      when 'GET', 'HEAD'
        response.status = 200
        response.set_header('Content-Type', @content_type)
        response.set_header('Content-Length', @message.length.to_s)
        response.start_body
        if (request.method != 'HEAD') then
          response.write(@message.dup)
        end
      else
        http_error = HTTPError.new(405)        # Method Not Allowed
        http_error.set_header('Allow', 'GET, HEAD')
        raise http_error
      end

      nil
    end