Skip to content

Commit 58208cc

Browse files
committed
fix pathname when no path
1 parent 984b21e commit 58208cc

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ version: '3.6'
3333

3434
services:
3535
llmp:
36-
image: ghcr.io/j4ys0n/llm-proxy:1.5.3
36+
image: ghcr.io/j4ys0n/llm-proxy:1.5.4
3737
container_name: llmp
3838
hostname: llmp
3939
restart: unless-stopped

docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ version: '3.6'
22

33
services:
44
llmp:
5-
image: ghcr.io/j4ys0n/llm-proxy:1.5.3
5+
image: ghcr.io/j4ys0n/llm-proxy:1.5.4
66
container_name: llmp
77
hostname: llmp
88
restart: unless-stopped

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "llm-proxy",
3-
"version": "1.5.3",
3+
"version": "1.5.4",
44
"description": "Manages Nginx for reverse proxy to multiple LLMs, with TLS & Bearer Auth tokens",
55
"main": "dist/index.js",
66
"scripts": {

src/controllers/llm.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ function getPath(url: string): { path: string, base: string, apiKey?: string } {
1919
try {
2020
const urlParts = url.split('|')
2121
const apiKey = urlParts.length > 1 ? urlParts[1] : undefined
22-
const urlObject = new URL(urlParts[0])
22+
const { origin, pathname } = new URL(urlParts[0])
2323
return {
24-
path: urlObject.pathname || '/v1',
25-
base: urlObject.origin,
24+
path: pathname === '/' ? '/v1' : pathname,
25+
base: origin,
2626
apiKey
2727
}
2828
} catch (error) {

0 commit comments

Comments
 (0)