From 77af16c9e4c12e42e628ba70168f068248ddacb5 Mon Sep 17 00:00:00 2001 From: Feynman Liang Date: Fri, 7 Apr 2017 06:51:29 -0700 Subject: [PATCH] Fix swagger-ui when "server-proxy-uri" is not set (#857) --- CHANGELOG.md | 1 + src/PostgREST/App.hs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 236bb3f69..b6918b29e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -16,6 +16,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). - Resource embedding in views referencing tables in public schema - @fab1an - #777, Empty body is allowed when calling a non-parameterized RPC - @koulakis - #831, Fix proc resource embedding issue with search_path - @steve-chavez +- #857, Fix swagger-ui when "server-proxy-uri" is not set - @feynmanliang ## [0.4.0.0] - 2017-01-19 diff --git a/src/PostgREST/App.hs b/src/PostgREST/App.hs index e223ba745..73235e57c 100644 --- a/src/PostgREST/App.hs +++ b/src/PostgREST/App.hs @@ -229,7 +229,7 @@ app dbStructure conf apiRequest = let host = configHost conf port = toInteger $ configPort conf proxy = pickProxy $ toS <$> configProxyUri conf - uri Nothing = ("http", host, port, "/") + uri Nothing = ("http", host, port, "") uri (Just Proxy { proxyScheme = s, proxyHost = h, proxyPort = p, proxyPath = b }) = (s, h, p, b) uri' = uri proxy encodeApi ti = encodeOpenAPI (M.elems $ dbProcs dbStructure) ti uri'