summaryrefslogtreecommitdiffstats
path: root/models/webhook.go
diff options
context:
space:
mode:
authorSandro Santilli <strk@kbt.io>2016-11-07 17:53:22 +0100
committerSandro Santilli <strk@kbt.io>2016-11-07 17:53:22 +0100
commitaadd7dcdc317c5e1665318b537162749514ac212 (patch)
tree5e4772ba6ca97dd7dca62325024ec4359b0636c0 /models/webhook.go
parentb3828e38a5fbb92a92bae11e1e126b87fbad09c8 (diff)
downloadgitea-aadd7dcdc317c5e1665318b537162749514ac212.tar.gz
gitea-aadd7dcdc317c5e1665318b537162749514ac212.zip
And others
Diffstat (limited to 'models/webhook.go')
-rw-r--r--models/webhook.go16
1 files changed, 8 insertions, 8 deletions
diff --git a/models/webhook.go b/models/webhook.go
index 4b5501715a..25c9326e7c 100644
--- a/models/webhook.go
+++ b/models/webhook.go
@@ -28,13 +28,13 @@ var HookQueue = sync.NewUniqueQueue(setting.Webhook.QueueLength)
type HookContentType int
const (
- JSON HookContentType = iota + 1
- FORM
+ ContentTypeJson HookContentType = iota + 1
+ ContentTypeForm
)
var hookContentTypes = map[string]HookContentType{
- "json": JSON,
- "form": FORM,
+ "json": ContentTypeJson,
+ "form": ContentTypeForm,
}
// ToHookContentType returns HookContentType by given name.
@@ -44,9 +44,9 @@ func ToHookContentType(name string) HookContentType {
func (t HookContentType) Name() string {
switch t {
- case JSON:
+ case ContentTypeJson:
return "json"
- case FORM:
+ case ContentTypeForm:
return "form"
}
return ""
@@ -511,9 +511,9 @@ func (t *HookTask) deliver() {
SetTLSClientConfig(&tls.Config{InsecureSkipVerify: setting.Webhook.SkipTLSVerify})
switch t.ContentType {
- case JSON:
+ case ContentTypeJson:
req = req.Header("Content-Type", "application/json").Body(t.PayloadContent)
- case FORM:
+ case ContentTypeForm:
req.Param("payload", t.PayloadContent)
}