-
-
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
Set correct content_type value for Gogs/Gitea webhooks (#9504) #10456
Conversation
The content_type value was defaulting to the string value of the ContentType, not the integer value as expected by the backend.
</div> | ||
{{template "repo/settings/webhook/settings" .}} | ||
</form> | ||
{{end}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My editor respected the .editorconfig
and reformatted the file with LF line endings. I can rework this to a minimal diff.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reminds me we still need to reformat the codebase to conform .editorconfig
. It will be a gigantic diff 😆
Codecov Report
@@ Coverage Diff @@
## master #10456 +/- ##
==========================================
+ Coverage 43.67% 43.68% +<.01%
==========================================
Files 586 586
Lines 81391 81521 +130
==========================================
+ Hits 35551 35611 +60
- Misses 41438 41495 +57
- Partials 4402 4415 +13
Continue to review full report at Codecov.
|
Maybe we should change the backend for better readability. |
<div class="field"> | ||
<label>{{.i18n.Tr "repo.settings.content_type"}}</label> | ||
<div class="ui selection dropdown"> | ||
<input type="hidden" id="content_type" name="content_type" value="{{if .Webhook.ContentType}}{{.Webhook.ContentType}}{{else}}1{{end}}"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why change ContentType for gitea too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please backport |
go-gitea#10456) The content_type value was defaulting to the string value of the ContentType, not the integer value as expected by the backend.
… (#11461) The content_type value was defaulting to the string value of the ContentType, not the integer value as expected by the backend. Co-authored-by: Jeff Stein <[email protected]>
The content_type value was defaulting to the string value of the ContentType, not the integer value as expected by the backend.
This addresses the problem seen in #9504.
Test steps:
Before change: The form will fail with "ContentType cannot be empty".
After change: The form will succeed and the webhook will be created.