Skip to content

Commit eebe4f1

Browse files
committed
copy paste issue
1 parent 1a3325a commit eebe4f1

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

internal/util/url.go

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
// Package util provides common utilities for the Olla application.
21
package util
32

43
import (
@@ -18,19 +17,6 @@ import (
1817
// Examples:
1918
// - ResolveURLPath("http://localhost:12434/api/", "/v1/models") -> "http://localhost:12434/api/v1/models"
2019
// - ResolveURLPath("http://localhost:12434/api/", "http://other:9000/models") -> "http://other:9000/models"
21-
//
22-
// ResolveURLPath resolves a path or absolute URL against a base URL.
23-
// This function exists because url.ResolveReference() follows RFC 3986 strictly,
24-
// treating paths with leading "/" as absolute references that replace the entire base path.
25-
// In our context, we want to preserve the base path prefix when joining with relative paths.
26-
//
27-
// We use url.Parse() and path.Join() to achieve the desired behaviour where:
28-
// - Absolute URLs (with scheme) are returned unchanged
29-
// - Relative paths are appended to the base URL's path, preserving the base path prefix
30-
//
31-
// Examples:
32-
// - ResolveURLPath("http://localhost:12434/api/", "/v1/models") -> "http://localhost:12434/api/v1/models"
33-
// - ResolveURLPath("http://localhost:12434/api/", "http://other:9000/models") -> "http://other:9000/models"
3420
func ResolveURLPath(baseURL, pathOrURL string) string {
3521
if baseURL == "" {
3622
return pathOrURL

0 commit comments

Comments
 (0)