Skip to content

Fix home link methods

Johannes Zumthurm requested to merge fix-home-methods into master

Created by: NotSpecial

For the home endpoint, some link methods were incorrect, i.e. the API would report that some methods are allowed for the current user (although they were not) and some of the reported methods would not be allowed.

This was the result of to unrelated problems:

  1. Not allowed HEAD: Eve automatically allows HEAD requests if GET is possible. However, if GET is set to public_methods, HEAD is not automatically included, and has to be set explicitly. Unaware of this, the API would report that HEAD is allowed, while it was not. I have corrected the respective resource configs such that HEAD is allowed whenever GET is, as it is intended.

  2. Allowed GET if it is not: Some resources using AdminOnlyAuth would not create a user lookup filter, but instead abort. The API had no way to check this properly, and would report that GET is possible (even if it would be aborted. I have changed the output of creating a lookup filter such that not allowing any lookup for a user can be properly returned. Now the API can correctly determine whether GET is possible or not.

Aside from that, I improved the tests for links on / to actually test all reported methods.

Closes #343 (closed).

Merge request reports

Loading