Skip to content

Commit fdf7e70

Browse files
committedMar 15, 2024·
fix(openapi): avoid double slash for base
1 parent f733032 commit fdf7e70

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed
 

‎src/runtime/routes/openapi.ts

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import type {
66
ParameterObject,
77
PathsObject,
88
} from "openapi-typescript";
9+
import { joinURL } from "ufo";
910
import { handlersMeta } from "#internal/nitro/virtual/server-handlers";
1011
import { useRuntimeConfig } from "#internal/nitro";
1112

1213
// Served as /_nitro/openapi.json
1314
export default eventHandler((event) => {
1415
const base = useRuntimeConfig()?.app?.baseURL;
1516

16-
const url = getRequestURL(event).origin + base;
17+
const url = joinURL(getRequestURL(event).origin, base);
1718

1819
return <OpenAPI3>{
1920
openapi: "3.0.0",

0 commit comments

Comments
 (0)
Please sign in to comment.