mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-29 01:33:10 -06:00
Linting
This commit is contained in:
parent
6e04b8022d
commit
02a6f9b8ec
|
|
@ -1,6 +1,7 @@
|
|||
package routing
|
||||
|
||||
import (
|
||||
"context"
|
||||
"crypto/hmac"
|
||||
"crypto/sha1"
|
||||
"encoding/hex"
|
||||
|
|
@ -11,6 +12,7 @@ import (
|
|||
"strings"
|
||||
"time"
|
||||
|
||||
"github.com/matrix-org/dendrite/internal"
|
||||
"github.com/matrix-org/util"
|
||||
cache "github.com/patrickmn/go-cache"
|
||||
)
|
||||
|
|
@ -25,7 +27,7 @@ type SharedSecretRegistrationRequest struct {
|
|||
}
|
||||
|
||||
func NewSharedSecretRegistrationRequest(reader io.ReadCloser) (*SharedSecretRegistrationRequest, error) {
|
||||
defer reader.Close()
|
||||
defer internal.CloseAndLogIfError(context.Background(), reader, "NewSharedSecretRegistrationRequest: failed to close request body")
|
||||
var ssrr SharedSecretRegistrationRequest
|
||||
err := json.NewDecoder(reader).Decode(&ssrr)
|
||||
if err != nil {
|
||||
|
|
|
|||
|
|
@ -94,7 +94,7 @@ func Setup(
|
|||
sr := NewSharedSecretRegistration(cfg.RegistrationSharedSecret)
|
||||
synapseAdminRouter.Handle("/admin/v1/register",
|
||||
httputil.MakeExternalAPI("shared_secret_registration", func(req *http.Request) util.JSONResponse {
|
||||
if req.Method == "GET" {
|
||||
if req.Method == http.MethodGet {
|
||||
return util.JSONResponse{
|
||||
Code: 200,
|
||||
JSON: struct {
|
||||
|
|
@ -104,7 +104,7 @@ func Setup(
|
|||
},
|
||||
}
|
||||
}
|
||||
if req.Method == "POST" {
|
||||
if req.Method == http.MethodPost {
|
||||
return handleSharedSecretRegistration(userAPI, sr, req)
|
||||
}
|
||||
return util.JSONResponse{
|
||||
|
|
|
|||
Loading…
Reference in a new issue