-
Notifications
You must be signed in to change notification settings - Fork 293
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
REST API improvements #657
Comments
I wouldn't do this. Trailing slashes (and double //) are the wrong path. We can assume the user means to use a path without trailing slashes and //, but this is just an assumption (probably wrong in most cases as this is an API and such urls are just the result of bugs in clients). When gorilla enables the possibility of doing 308 redirects we can think of it as it would come for free, but right now things a better without any extra handling.
Yes, we can do this.
ContentType different than json is used when using /add to make a multipart post.
Only a single test to detect that a catchall route returns 404 with the json message. |
Currently |
It should probably return it, so it can be checked per test, when needed. |
The main actionable here is to make sure all errors are JSON (and test). |
Inspired from discussions that happened in #634
error not found 404
, it should return a JSON response.makePostWithContentType
and other similar test helper functions, which should work for given content type judging them by their names, but there logic assumes that we are always using Content-Type asapplication/json
.processResp
andcheckHeaders
assumes that response should have. I don't see a point in havingWithContentType
functions when we know all responses should return json responses.error not found 404
, but a JSON response.Should be done after #634 is merged. #634 won't be perfect, but I think changes in this issue should make it so.
Thoughts?
The text was updated successfully, but these errors were encountered: