class Tilia::Dav::Exception::MethodNotAllowed

MethodNotAllowed

The 405 is thrown when a client tried to create a directory on an already existing directory

Public Instance Methods

http_code() click to toggle source

Returns the HTTP statuscode for this exception

@return int

# File lib/tilia/dav/exception/method_not_allowed.rb, line 12
def http_code
  405
end
http_headers(server) click to toggle source

This method allows the exception to return any extra HTTP response headers.

The headers must be returned as an array.

@param SabreDAVServer server @return array

# File lib/tilia/dav/exception/method_not_allowed.rb, line 22
def http_headers(server)
  methods = server.allowed_methods(server.request_uri)
  { 'Allow' => methods.join(', ').upcase }
end