mirror of
https://github.com/LukeHagar/libopenapi.git
synced 2025-12-09 12:37:49 +00:00
Fixed async isues with index #91
The index runs async everywhere, it's kinda impossible to know which path with resolve first, so testing is hard. Sometimes a race condition is hit, well, it was. Now that map has a mutex on it. Also fully fixed handling files with relative links. A basepath property has been added to the index configuration to allow a local root to be set when resolving files. Added a full checkout test for digital ocean so that full remote and full local testing is performed.
This commit is contained in:
@@ -433,7 +433,12 @@ func GenerateCleanSpecConfigBaseURL(baseURL *url.URL, dir string, includeFile bo
|
||||
if baseURL.Scheme != "" && !strings.HasPrefix(dir, "http") {
|
||||
p = fmt.Sprintf("%s://%s%s", baseURL.Scheme, baseURL.Host, cleanedPath)
|
||||
} else {
|
||||
p = cleanedPath
|
||||
if !strings.Contains(cleanedPath, "/") {
|
||||
p = ""
|
||||
} else {
|
||||
p = cleanedPath
|
||||
}
|
||||
|
||||
}
|
||||
if strings.HasSuffix(p, "/") {
|
||||
p = p[:len(p)-1]
|
||||
|
||||
Reference in New Issue
Block a user