From 61e5e6bc36adb51b3ba29d27f5208222a8d69db3 Mon Sep 17 00:00:00 2001 From: Ettore Di Giacinto Date: Sat, 30 Mar 2024 12:04:41 +0100 Subject: [PATCH] fix(swagger): do not specify a host (#1930) In this way the requests are redirected to the host used by the client to perform the request. --- core/http/api.go | 1 - swagger/docs.go | 2 +- swagger/swagger.json | 1 - swagger/swagger.yaml | 1 - 4 files changed, 1 insertion(+), 4 deletions(-) diff --git a/core/http/api.go b/core/http/api.go index ff413b0a..af38512a 100644 --- a/core/http/api.go +++ b/core/http/api.go @@ -51,7 +51,6 @@ func readAuthHeader(c *fiber.Ctx) string { // @contact.url https://localai.io // @license.name MIT // @license.url https://raw.githubusercontent.com/mudler/LocalAI/master/LICENSE -// @host localhost:8080 // @BasePath / // @securityDefinitions.apikey BearerAuth // @in header diff --git a/swagger/docs.go b/swagger/docs.go index 0f5c2c47..e0199673 100644 --- a/swagger/docs.go +++ b/swagger/docs.go @@ -785,7 +785,7 @@ const docTemplate = `{ // SwaggerInfo holds exported Swagger Info so clients can modify it var SwaggerInfo = &swag.Spec{ Version: "2.0.0", - Host: "localhost:8080", + Host: "", BasePath: "/", Schemes: []string{}, Title: "LocalAI API", diff --git a/swagger/swagger.json b/swagger/swagger.json index 37dbec47..4d7102c4 100644 --- a/swagger/swagger.json +++ b/swagger/swagger.json @@ -13,7 +13,6 @@ }, "version": "2.0.0" }, - "host": "localhost:8080", "basePath": "/", "paths": { "/v1/assistants": { diff --git a/swagger/swagger.yaml b/swagger/swagger.yaml index 91180359..86caff8a 100644 --- a/swagger/swagger.yaml +++ b/swagger/swagger.yaml @@ -365,7 +365,6 @@ definitions: type: type: string type: object -host: localhost:8080 info: contact: name: LocalAI