mirror of
https://github.com/go-gitea/gitea
synced 2025-07-09 20:17:21 +00:00
Fix type in unused constant name (#111)
* Write LDAP, SMTP, PAM, DLDAP back to all uppercase * Fix type in unused constant name * Other MixCased fixes * Complete MixerCasing of template constants * Re uppercase LTS and LDAPS suffixes * Uppercase JSON suffix in constant names * Proper case LoginNoType * Prefix unexported template path constants with "tpl"
This commit is contained in:
committed by
Andrey Nering
parent
c8c748aea6
commit
864d1b1f9f
@ -28,12 +28,12 @@ var HookQueue = sync.NewUniqueQueue(setting.Webhook.QueueLength)
|
||||
type HookContentType int
|
||||
|
||||
const (
|
||||
ContentTypeJson HookContentType = iota + 1
|
||||
ContentTypeJSON HookContentType = iota + 1
|
||||
ContentTypeForm
|
||||
)
|
||||
|
||||
var hookContentTypes = map[string]HookContentType{
|
||||
"json": ContentTypeJson,
|
||||
"json": ContentTypeJSON,
|
||||
"form": ContentTypeForm,
|
||||
}
|
||||
|
||||
@ -44,7 +44,7 @@ func ToHookContentType(name string) HookContentType {
|
||||
|
||||
func (t HookContentType) Name() string {
|
||||
switch t {
|
||||
case ContentTypeJson:
|
||||
case ContentTypeJSON:
|
||||
return "json"
|
||||
case ContentTypeForm:
|
||||
return "form"
|
||||
@ -511,7 +511,7 @@ func (t *HookTask) deliver() {
|
||||
SetTLSClientConfig(&tls.Config{InsecureSkipVerify: setting.Webhook.SkipTLSVerify})
|
||||
|
||||
switch t.ContentType {
|
||||
case ContentTypeJson:
|
||||
case ContentTypeJSON:
|
||||
req = req.Header("Content-Type", "application/json").Body(t.PayloadContent)
|
||||
case ContentTypeForm:
|
||||
req.Param("payload", t.PayloadContent)
|
||||
|
Reference in New Issue
Block a user