This commit is contained in:
crusader 2018-04-13 16:21:17 +09:00
parent 8ab605b526
commit a4a77c7088
3 changed files with 9 additions and 9 deletions

View File

@ -78,7 +78,7 @@ func (s *AuthServlets) Handshake(servletCtx server.ServletCtx, ctx *fasthttp.Req
case ocnc.HTTPRequestHeaderValue_NoAuthProbe_Method_Regist: case ocnc.HTTPRequestHeaderValue_NoAuthProbe_Method_Regist:
bInfo := ctx.Request.Header.Peek(ocnc.HTTPRequestHeaderKey_NoAuthProbe_Info) bInfo := ctx.Request.Header.Peek(ocnc.HTTPRequestHeaderKey_NoAuthProbe_Info)
if nil == bInfo { if nil == bInfo {
return nil, fmt.Errorf("Unexpected HTTPRequestHeaderKey NoAuthProbe Info") return nil, fmt.Errorf("Unexpected Request Header Key NoAuthProbe Info")
} }
rJSON := make([]byte, base64.StdEncoding.DecodedLen(len(bInfo))) rJSON := make([]byte, base64.StdEncoding.DecodedLen(len(bInfo)))
_, err := base64.StdEncoding.Decode(rJSON, bInfo) _, err := base64.StdEncoding.Decode(rJSON, bInfo)
@ -122,7 +122,7 @@ func (s *AuthServlets) Handshake(servletCtx server.ServletCtx, ctx *fasthttp.Req
return nil, nil return nil, nil
default: default:
return nil, fmt.Errorf("Unexpected noauth probe httpRequestHeaderValue: %v", method) return nil, fmt.Errorf("Unexpected noauth probe method: %s", method)
} }
} }

View File

@ -1,20 +1,20 @@
package servlet package servlet
import ( import (
"fmt"
"encoding/json"
"context" "context"
"crypto/rsa" "crypto/rsa"
"encoding/json"
"fmt"
"sync" "sync"
"github.com/valyala/fasthttp" "github.com/valyala/fasthttp"
"git.loafle.net/commons/server-go" "git.loafle.net/commons/server-go"
"git.loafle.net/commons/server-go/socket" "git.loafle.net/commons/server-go/socket"
"git.loafle.net/overflow/gateway/external/grpc"
og "git.loafle.net/overflow/gateway"
ocpc "git.loafle.net/overflow/commons-go/probe/constants" ocpc "git.loafle.net/overflow/commons-go/probe/constants"
ocpm "git.loafle.net/overflow/commons-go/probe/model" ocpm "git.loafle.net/overflow/commons-go/probe/model"
og "git.loafle.net/overflow/gateway"
"git.loafle.net/overflow/gateway/external/grpc"
ogrs "git.loafle.net/overflow/gateway_rpc/servlet" ogrs "git.loafle.net/overflow/gateway_rpc/servlet"
) )
@ -69,7 +69,7 @@ func (s *DataServlets) Handshake(servletCtx server.ServletCtx, ctx *fasthttp.Req
switch method { switch method {
case ocpc.HTTPRequestHeaderValue_Probe_Method_Connect: case ocpc.HTTPRequestHeaderValue_Probe_Method_Connect:
default: default:
return nil, fmt.Errorf("Unexpected noauth probe httpRequestHeaderValue: %v", method) return nil, fmt.Errorf("Unexpected probe method: %s", method)
} }
bProbeKey := ctx.Request.Header.Peek(ocpc.HTTPRequestHeaderKey_Probe_ProbeKey) bProbeKey := ctx.Request.Header.Peek(ocpc.HTTPRequestHeaderKey_Probe_ProbeKey)

View File

@ -75,7 +75,7 @@ func (s *ProbeServlets) Handshake(servletCtx server.ServletCtx, ctx *fasthttp.Re
switch method { switch method {
case ocpc.HTTPRequestHeaderValue_Probe_Method_Connect: case ocpc.HTTPRequestHeaderValue_Probe_Method_Connect:
default: default:
return nil, fmt.Errorf("Unexpected noauth probe httpRequestHeaderValue: %v", method) return nil, fmt.Errorf("Unexpected probe method: %s", method)
} }
bProbeKey := ctx.Request.Header.Peek(ocpc.HTTPRequestHeaderKey_Probe_ProbeKey) bProbeKey := ctx.Request.Header.Peek(ocpc.HTTPRequestHeaderKey_Probe_ProbeKey)