Skip to content

Commit

Permalink
added windows check for patch conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
daveshanley committed Jun 13, 2024
1 parent 2ddd1b5 commit df609ab
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"net/http"
"net/url"
"regexp"
"runtime"
"sort"
"strconv"
"strings"
Expand Down Expand Up @@ -602,7 +603,8 @@ func ConvertComponentIdIntoFriendlyPathSearch(id string) (string, string) {
if pathCharExp.Match([]byte(segs[i])) {

segs[i], _ = url.QueryUnescape(strings.ReplaceAll(segs[i], "~1", "/"))
if strings.Contains(id, "#") && strings.Contains(segs[i], `\`) {
// strip out any backslashes, but only on non-windows systems.
if runtime.GOOS != "windows" && strings.Contains(id, "#") && strings.Contains(segs[i], `\`) {
segs[i] = strings.ReplaceAll(segs[i], `\`, "")
cleaned = append(cleaned, segs[i])
continue

Check warning on line 610 in utils/utils.go

View check run for this annotation

Codecov / codecov/patch

utils/utils.go#L608-L610

Added lines #L608 - L610 were not covered by tests
Expand Down

0 comments on commit df609ab

Please sign in to comment.