diff --git a/lib/open_api_spex/plug/swagger_ui.ex b/lib/open_api_spex/plug/swagger_ui.ex index 9fb72986..d1fafb44 100644 --- a/lib/open_api_spex/plug/swagger_ui.ex +++ b/lib/open_api_spex/plug/swagger_ui.ex @@ -90,8 +90,7 @@ defmodule OpenApiSpex.Plug.SwaggerUI do <% end %> window.onload = function() { // Begin Swagger UI call region - const api_spec_url = new URL(window.location); - api_spec_url.pathname = "<%= config.path %>"; + const api_spec_url = new URL("<%= config.path %>", window.location); api_spec_url.hash = ""; const ui = SwaggerUIBundle({ url: api_spec_url.href,