mirror of
https://github.com/go-gitea/gitea.git
synced 2025-07-04 03:40:52 +02:00
Open the DingTalk link in browser (#17084)
https://developers.dingtalk.com/document/app/message-link-description To open the link in browser, we should use this URL: `"dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL)` Otherwise the page is displayed inside DingTalk client, it makes users very difficult to visit non-public URLs in DingTalk webhook messages.
This commit is contained in:
@ -6,6 +6,7 @@ package webhook
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"net/url"
|
||||
"strings"
|
||||
|
||||
"code.gitea.io/gitea/models"
|
||||
@ -175,7 +176,10 @@ func createDingtalkPayload(title, text, singleTitle, singleURL string) *Dingtalk
|
||||
Title: strings.TrimSpace(title),
|
||||
HideAvatar: "0",
|
||||
SingleTitle: singleTitle,
|
||||
SingleURL: singleURL,
|
||||
|
||||
// https://developers.dingtalk.com/document/app/message-link-description
|
||||
// to open the link in browser, we should use this URL, otherwise the page is displayed inside DingTalk client, very difficult to visit non-public URLs.
|
||||
SingleURL: "dingtalk://dingtalkclient/page/link?pc_slide=false&url=" + url.QueryEscape(singleURL),
|
||||
},
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user