Explorar el Código

Fix secret checking

DarthSim hace 6 años
padre
commit
77d86d0e2d
Se han modificado 1 ficheros con 1 adiciones y 3 borrados
  1. 1 3
      server.go

+ 1 - 3
server.go

@@ -113,9 +113,7 @@ func respondWithOptions(reqID string, rctx *fasthttp.RequestCtx) {
 
 func prepareAuthHeaderMust() []byte {
 	if len(authHeaderMust) == 0 {
-		buf := bytes.NewBufferString("Bearer ")
-		buf.WriteString(conf.Secret)
-		authHeaderMust = []byte(conf.Secret)
+		authHeaderMust = []byte(fmt.Sprintf("Bearer %s", conf.Secret))
 	}
 
 	return authHeaderMust