DataONEorg / bookkeeper

Bookkeeper keeps track of DataONE product subscriptions and quotas for researchers using the extended services.
Other
1 stars 2 forks source link

Quota endpoint is returning '202 no content'` #61

Closed gothub closed 3 years ago

gothub commented 4 years ago

The following request should return HTTP 404, but returns 202 instead:

curl -v -X GET "https://api.test.dataone.org:30443/bookkeeper/v1/quotas/10000" \
     -H "Origin: https://avatar.nceas.ucsb.edu" \
     -H "Authorization: Bearer $token"
...
< HTTP/1.1 204 No Content
< Server: nginx/1.19.0
< Date: Tue, 25 Aug 2020 21:29:13 GMT
< Connection: keep-alive
< Access-Control-Allow-Origin: https://avatar.nceas.ucsb.edu
< Access-Control-Allow-Methods: GET, POST, OPTIONS, PUT, DELETE
< Access-Control-Allow-Headers: Authorization, Content-Type, Origin, Cache-Control
< Access-Control-Allow-Credentials: true

If the quota is found, the proper HTTP result is returned.

gothub commented 3 years ago

In addition, for QuotaResource.retrieve() perform an authorization check.

gothub commented 3 years ago

An HTTP 404 status is returned if the requested quota is not found. Fixed in commit 9320122ea85b7ef4e9e8fc1e20dea0b05b0b12d8