waagsociety / citysdk-ld

CitySDK Linked Data API
MIT License
60 stars 4 forks source link

Wrong HTTP method to URL should result in error #13

Closed bertspaan closed 10 years ago

bertspaan commented 10 years ago

Doing a PATCH request to a URL to which only GET and POST requests are allowed should result in an error. Example:

curl --request PATCH --data "{\"a\": \"b\"}" http://localhost:9292/owners
bertspaan commented 10 years ago

Done. API now returns 405 Method Not Allowed with Allow header set. Problem was in serializer.rb, which tried to always serialize results. Serializer is skipped when object.class != Hash. Closes #13.