Skip to content

Commit

Permalink
Use std function for url cleaning
Browse files Browse the repository at this point in the history
  • Loading branch information
hkalodner committed Jun 28, 2022
1 parent 09721d4 commit 12b8c3a
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions das/restful_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ import (
"fmt"
"net"
"net/http"
"path"
"strings"

"github.com/coreos/etcd/pkg/pathutil"

"github.com/ethereum/go-ethereum/log"
"github.com/offchainlabs/nitro/arbstate"
"github.com/offchainlabs/nitro/util/pretty"
Expand Down Expand Up @@ -69,7 +68,7 @@ const expirationPolicyRequestPath = "/expiration-policy/"
const getByHashRequestPath = "/get-by-hash/"

func (rds *RestfulDasServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
requestPath := pathutil.CanonicalURLPath(r.URL.Path)
requestPath := path.Clean(r.URL.Path)
log.Debug("Got request", "requestPath", requestPath)
switch {
case strings.HasPrefix(requestPath, healthRequestPath):
Expand Down

0 comments on commit 12b8c3a

Please sign in to comment.