-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Some API parameter parsing error #24574
Comments
I checked Current implementation of last_read_at supports values that applicable to RFC3339 standard only: I think that it will be good to support timestamp type values as well. |
…gitea#24823) Should resolve first point of the issue go-gitea#24574
) (#24830) Backport #24823 by @sonjek Should resolve first point of the issue #24574 Co-authored-by: Yevhen Pavlov <[email protected]>
…gitea#24823) (go-gitea#24830) Backport go-gitea#24823 by @sonjek Should resolve first point of the issue go-gitea#24574 Co-authored-by: Yevhen Pavlov <[email protected]> (cherry picked from commit f29c52a)
Description
When I use API to access Gitea,I got some 500 response code from Gitea.But I think I should recieve 4xx code,so I think these API have some bug in design period
1. webhook-id not found
API PATH
Method
GET,PATCH
RequestBody
{}
URL
http://localhost:3000/api/v1/admin/hooks/14
Response code and message
Problem description
In fact, I think that when I access a non-existent webhook-id, I should receive a 4xx response code, e.g. 404 instead of 500
2. last_read_at parameter parsing error
API PATH
Method
PUT
RequestBody
""
URL
http://localhost:3000/api/v1/notifications?last_read_at\u003d1682567431888
Response code and message
Problem description
I think Gitea should return me a 4xx error when I enter an incorrect parameter format, or forbid me to enter parameters in this format
3. Usename inconsistency
API PATH
Method
POST
RequestBody
{"location": "fuzzstring", "username": "fake_name"}"
URL
http://localhost:3000/api/v1/admin/users/real_name/orgs
Response code and message
Problem description
This 500 error occurs when the username parameter I entered in the requestBody does not match the username parameter in the url path, it is worth mentioning that the username in the url path is actual, while the username parameter in the requestBody is fictitious.I think I should have received a 4xx response code, or a critical check of the parameters
Gitea Version
1.19.1
Can you reproduce the bug on the Gitea demo site?
Yes
Log Gist
No response
Screenshots
No response
Git Version
No response
Operating System
No response
How are you running Gitea?
I build Gitea by using https://dl.gitea.com/gitea/1.19.1/gitea-1.19.1-linux-amd64
Database
PostgreSQL
The text was updated successfully, but these errors were encountered: