Skip to content
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

Update failed if the website field is carried, when requesting /user/settings interface. #30518

Closed
Gitttttttt opened this issue Apr 16, 2024 · 10 comments · Fixed by #30539
Closed
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug type/upstream This is an issue in one of Gitea's dependencies and should be reported there
Milestone

Comments

@Gitttttttt
Copy link

Gitttttttt commented Apr 16, 2024

Description

The request is:

curl -X 'PATCH' \ 'https://172.16.161.221:8080/api/v1/user/settings' \ -H 'accept: application/json' \ -H 'authorization: Basic cm9vdDp6ZHd3QDIwMjQ=' \ -H 'Content-Type: application/json' \ -d '{ "description": "", "location": "", "language": "zh-CN", "theme": "auto", "full_name": "root", "diff_view_style": "", "hide_email": true, "hide_activity": false, "website": "gitea.com" }'

The result is:

image

Is the parameter value wrong or Is it a bug?

Gitea Version

1.21.7

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?

docker

Database

None

@lunny
Copy link
Member

lunny commented Apr 16, 2024

Website should be https://gitea.com.

@Gitttttttt
Copy link
Author

Gitttttttt commented Apr 17, 2024

@lunny I hava tryied, but got the same error, even with https://www.xxx.com:
image

@lunny
Copy link
Member

lunny commented Apr 17, 2024

I cannot reproduce this and I create a test PR in #30539. Maybe you can upgrade to 1.21.11 and try again?

lunny added a commit that referenced this issue Apr 18, 2024
@Gitttttttt
Copy link
Author

@lunny I upgraded to 1.21.11 and tried again, but it's still the same error.
The version:
image

The request:
image

The response:
image

@lunny
Copy link
Member

lunny commented Apr 24, 2024

Please input token <your_token> in AuthorizationHeaderToken (apiKey) of the Authorized and try again.

@Gitttttttt
Copy link
Author

@lunny Like this? Seems to be the same result:

image

@lunny
Copy link
Member

lunny commented Apr 24, 2024

Can you get the information about this request/response from Gitea's log?

@Gitttttttt
Copy link
Author

@lunny The log only like this:
image

2024/04/24 11:01:08 ...eb/routing/logger.go:102:func1() [I] router: completed PATCH /api/v1/user/settings for 172.16.60.73:54290, 422 Unprocessable Entity in 32.4ms @ v1/api.go:689(v1.Routes.func1.7.1.bind[...])

@wxiaoguang
Copy link
Contributor

wxiaoguang commented Apr 24, 2024

It is a bug of go-chi/binding.

Main branch doesn't have such bug because its dependency has been upgraded.

On 1.21 branch, run go get gitea.com/go-chi/binding then build a new binary, then there won't be such bug.

@wxiaoguang wxiaoguang reopened this Apr 24, 2024
@wxiaoguang wxiaoguang added this to the 1.21.12 milestone Apr 24, 2024
@wxiaoguang wxiaoguang added the issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented label Apr 24, 2024
@yp05327 yp05327 added the type/upstream This is an issue in one of Gitea's dependencies and should be reported there label Apr 30, 2024
6543 pushed a commit that referenced this issue May 2, 2024
@lunny
Copy link
Member

lunny commented May 13, 2024

Fixed by #30742

@lunny lunny closed this as completed May 13, 2024
@go-gitea go-gitea locked as resolved and limited conversation to collaborators Aug 11, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
issue/confirmed Issue has been reviewed and confirmed to be present or accepted to be implemented type/bug type/upstream This is an issue in one of Gitea's dependencies and should be reported there
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants