Support custom channel now
This commit is contained in:
1 parent
17deb964ab
commit
32755d875a
8 files changed
+55
-8
No files matched your search
@@ -11,6 +11,9 @@ import (
|
||||
func Relay(c *gin.Context) {
|
||||
channelType := c.GetInt("channel")
|
||||
baseURL := common.ChannelBaseURLs[channelType]
|
||||
if channelType == common.ChannelTypeCustom {
|
||||
baseURL = c.GetString("base_url")
|
||||
}
|
||||
req, err := http.NewRequest(c.Request.Method, fmt.Sprintf("%s%s", baseURL, c.Request.URL.String()), c.Request.Body)
|
||||
if err != nil {
|
||||
c.JSON(http.StatusOK, gin.H{
|
||||
|
||||
Reference in new issue
Block a user