(a, b string)
| 49 | } |
| 50 | |
| 51 | func singleJoiningSlash(a, b string) string { |
| 52 | if b == "" { |
| 53 | return a |
| 54 | } |
| 55 | |
| 56 | aslash := strings.HasSuffix(a, "/") |
| 57 | bslash := strings.HasPrefix(b, "/") |
| 58 | switch { |
| 59 | case aslash && bslash: |
| 60 | return a + b[1:] |
| 61 | case !aslash && !bslash: |
| 62 | return a + "/" + b |
| 63 | } |
| 64 | return a + b |
| 65 | } |
| 66 | |
| 67 | // NewSingleHostReverseProxy returns a new ReverseProxy that rewrites |
| 68 | // URLs to the scheme, host, and base path provided in target. If the |
no outgoing calls
no test coverage detected