mirror of
https://github.com/v2rayA/v2rayA.git
synced 2026-11-20 23:02:25 +03:00
PostImport, PutPorts, PutDnsRules, PutRoutingA, PutGFWList,
DeleteGFWList, PutDomainsExcluded, PutTproxyWhiteIpGroups, PostOutbound
and PutOutbound wrote the store and regenerated the core outside the
mutation turn, so two of them could interleave core restarts with each
other or with a latency test. They take it like the rest.
ParseSSURL and ParseVmessURL sliced past the end of a link shorter than
its scheme prefix ("ss:", "vmess:x"), a panic reachable from a
subscription line.
32 lines
688 B
Go
32 lines
688 B
Go
package controller
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"github.com/v2rayA/v2rayA/common"
|
|
"github.com/v2rayA/v2rayA/db/configure"
|
|
)
|
|
|
|
func GetDomainsExcluded(ctx *gin.Context) {
|
|
common.ResponseSuccess(ctx, gin.H{
|
|
"domains": configure.GetDomainsExcluded(),
|
|
})
|
|
}
|
|
|
|
func PutDomainsExcluded(ctx *gin.Context) {
|
|
release, ok := beginMutation(ctx)
|
|
if !ok {
|
|
return
|
|
}
|
|
defer release()
|
|
var data struct {
|
|
DomainList string `json:"domains"`
|
|
}
|
|
err := ctx.ShouldBindJSON(&data)
|
|
if err != nil {
|
|
common.ResponseError(ctx, badRequest("domains", "request body must be {\"domains\": string}"))
|
|
return
|
|
}
|
|
configure.SetDomainsExcluded(data.DomainList)
|
|
common.ResponseSuccess(ctx, nil)
|
|
}
|