strings.Title - strings.ToTitle

This commit is contained in:
李子铭 2024-11-19 10:41:36 +08:00
parent eef828ef7f
commit 0c674a9557
3 changed files with 9 additions and 9 deletions

View File

@ -6,7 +6,7 @@ import (
"encoding/json"
"fmt"
"gitea.cdlsxd.cn/sdk/plugin/proto"
"io/ioutil"
"io"
"net/http"
"strings"
)
@ -77,13 +77,13 @@ func (p *ZLTXCardV1Service) Notify(ctx context.Context, request *proto.NotifyReq
}
newHeaders := make(http.Header)
for key, values := range httpHeaders {
newKey := strings.Title(strings.ToLower(key))
newKey := strings.ToTitle(strings.ToLower(key))
newHeaders[newKey] = values
}
req := &http.Request{
Header: newHeaders,
Body: ioutil.NopCloser(bytes.NewBuffer(request.Body)),
Body: io.NopCloser(bytes.NewBuffer(request.Body)),
}
dctW, err := c.dctW()

View File

@ -7,7 +7,7 @@ import (
"fmt"
"gitea.cdlsxd.cn/sdk/plugin/dctw/v1/api/direct"
"gitea.cdlsxd.cn/sdk/plugin/proto"
"io/ioutil"
"io"
"net/http"
"strings"
)
@ -85,13 +85,13 @@ func (p *ZLTXV1Service) Notify(ctx context.Context, request *proto.NotifyRequest
}
newHeaders := make(http.Header)
for key, values := range httpHeaders {
newKey := strings.Title(strings.ToLower(key))
newKey := strings.ToTitle(strings.ToLower(key))
newHeaders[newKey] = values
}
req := &http.Request{
Header: newHeaders,
Body: ioutil.NopCloser(bytes.NewBuffer(request.Body)),
Body: io.NopCloser(bytes.NewBuffer(request.Body)),
}
a := &direct.Direct{DctWServer: server}

View File

@ -8,7 +8,7 @@ import (
"gitea.cdlsxd.cn/sdk/plugin/proto"
"gitee.com/chengdu_blue_brothers/openapi-go-sdk-v2/api"
"gitee.com/chengdu_blue_brothers/openapi-go-sdk-v2/notify"
"io/ioutil"
"io"
"net/http"
"strings"
)
@ -75,11 +75,11 @@ func (p *ZLTXV2Service) Notify(_ context.Context, request *proto.NotifyRequest)
}
newHeaders := make(http.Header)
for key, values := range httpHeaders {
newKey := strings.Title(strings.ToLower(key))
newKey := strings.ToTitle(strings.ToLower(key))
newHeaders[newKey] = values
}
req.Header = newHeaders
req.Body = ioutil.NopCloser(bytes.NewBuffer(request.Body))
req.Body = io.NopCloser(bytes.NewBuffer(request.Body))
c, err := transConfig(request.Config)
if err != nil {