mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
added windows check for patch conversion
This commit is contained in:
@@ -7,6 +7,7 @@ import (
|
|||||||
"net/http"
|
"net/http"
|
||||||
"net/url"
|
"net/url"
|
||||||
"regexp"
|
"regexp"
|
||||||
|
"runtime"
|
||||||
"sort"
|
"sort"
|
||||||
"strconv"
|
"strconv"
|
||||||
"strings"
|
"strings"
|
||||||
@@ -602,7 +603,8 @@ func ConvertComponentIdIntoFriendlyPathSearch(id string) (string, string) {
|
|||||||
if pathCharExp.Match([]byte(segs[i])) {
|
if pathCharExp.Match([]byte(segs[i])) {
|
||||||
|
|
||||||
segs[i], _ = url.QueryUnescape(strings.ReplaceAll(segs[i], "~1", "/"))
|
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], `\`, "")
|
segs[i] = strings.ReplaceAll(segs[i], `\`, "")
|
||||||
cleaned = append(cleaned, segs[i])
|
cleaned = append(cleaned, segs[i])
|
||||||
continue
|
continue
|
||||||
|
|||||||
Reference in New Issue
Block a user