Skip to content

Commit

Permalink
fix linter
Browse files Browse the repository at this point in the history
  • Loading branch information
volodymyr-basiuk committed Jan 13, 2025
1 parent 3462737 commit 5a9e604
Showing 1 changed file with 4 additions and 10 deletions.
14 changes: 4 additions & 10 deletions auth.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"log"
"math/big"
"net/http"
"strings"
"time"

"github.com/ethereum/go-ethereum/common"
Expand Down Expand Up @@ -617,12 +616,13 @@ func (v *Verifier) FullVerify(
if err != nil {
return nil, err
}
err = v.isResponseTypeAccepted(request.Body.Accept, token)

msg, mediaType, err := v.packageManager.Unpack([]byte(token))
if err != nil {
return nil, err
}

msg, _, err := v.packageManager.Unpack([]byte(token))
err = isResponseTypeAccepted(request.Body.Accept, mediaType)
if err != nil {
return nil, err
}
Expand Down Expand Up @@ -726,17 +726,11 @@ func getDocumentLoader(docLoader ld.DocumentLoader, ipfsCli schemaloaders.IPFSCl
return schemaloaders.NewDocumentLoader(ipfsCli, ipfsGW)
}

func (v *Verifier) isResponseTypeAccepted(requestAccept []string, token string) error {
func isResponseTypeAccepted(requestAccept []string, responseMediaType iden3comm.MediaType) error {
if len(requestAccept) == 0 {
return nil
}

safeEnvelope := strings.Trim(strings.TrimSpace(string(token)), "\"")
responseMediaType, err := v.packageManager.GetMediaType([]byte(safeEnvelope))
if err != nil {
return err
}

for _, profile := range requestAccept {
profileParsed, err := utils.ParseAcceptProfile(profile)
if err != nil {
Expand Down

0 comments on commit 5a9e604

Please sign in to comment.