diff --git a/CHANGELOG.md b/CHANGELOG.md index 1d03131e9..f1150fe1f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ This project adheres to [Semantic Versioning](http://semver.org/). ## Fixed - Fix `db-pre-config` function failing when function names are pg reserved words by @taimoorzaeem in #4380 +- Fix `server-host=!6` incorrectly binds to IPv4 address by @taimoorzaeem in #3202 ## [14.0] - 2025-10-24 diff --git a/cabal.project.freeze b/cabal.project.freeze index 969ea8cd0..60d041545 100644 --- a/cabal.project.freeze +++ b/cabal.project.freeze @@ -1 +1 @@ -index-state: hackage.haskell.org 2025-10-13T04:53:27Z +index-state: hackage.haskell.org 2025-10-29T04:02:18Z diff --git a/nix/overlays/haskell-packages.nix b/nix/overlays/haskell-packages.nix index 577e5162b..36feba764 100644 --- a/nix/overlays/haskell-packages.nix +++ b/nix/overlays/haskell-packages.nix @@ -60,6 +60,16 @@ let } { }; + # TODO: Remove once available in nixpkgs haskellPackages + streaming-commons = + prev.callHackageDirect + { + pkg = "streaming-commons"; + ver = "0.2.3.1"; + sha256 = "sha256-Gl2eaJcWe1sxmcE/octWlH9uSnERguf+5H66K4fV87s="; + } + { }; + # Downgrade hasql and related packages while we are still on GHC 9.4 for the static build. hasql = lib.dontCheck (lib.doJailbreak prev.hasql_1_6_4_4); hasql-dynamic-statements = lib.dontCheck prev.hasql-dynamic-statements_0_3_1_5; diff --git a/postgrest.cabal b/postgrest.cabal index c6a16162e..f9b10f6b0 100644 --- a/postgrest.cabal +++ b/postgrest.cabal @@ -139,7 +139,7 @@ library , regex-tdfa >= 1.2.2 && < 1.4 , retry >= 0.7.4 && < 0.10 , scientific >= 0.3.4 && < 0.4 - , streaming-commons >= 0.1.1 && < 0.3 + , streaming-commons >= 0.2.3.1 && < 0.3 , swagger2 >= 2.4 && < 2.9 , text >= 1.2.2 && < 2.2 , time >= 1.6 && < 1.13 diff --git a/stack.yaml b/stack.yaml index 0dabf21a6..f6db01a22 100644 --- a/stack.yaml +++ b/stack.yaml @@ -14,3 +14,4 @@ extra-deps: - hasql-pool-1.0.1 - jose-jwt-0.10.0 - postgresql-libpq-0.10.1.0 + - streaming-commons-0.2.3.1 diff --git a/stack.yaml.lock b/stack.yaml.lock index 17d466635..b3d989f1d 100644 --- a/stack.yaml.lock +++ b/stack.yaml.lock @@ -39,6 +39,13 @@ packages: size: 1096 original: hackage: postgresql-libpq-0.10.1.0 +- completed: + hackage: streaming-commons-0.2.3.1@sha256:ed7999fea9e912b1211ea93d7e20a7998bf4753166370c94048885650f303bf0,4841 + pantry-tree: + sha256: f08e83fb00fd45865fa8cfdef5ecef7161d5135257ee98050bfbe4b807ad65f8 + size: 2374 + original: + hackage: streaming-commons-0.2.3.1 snapshots: - completed: sha256: 238fa745b64f91184f9aa518fe04bdde6552533d169b0da5256670df83a0f1a9 diff --git a/test/io/postgrest.py b/test/io/postgrest.py index 531a05bee..efea3ef4f 100644 --- a/test/io/postgrest.py +++ b/test/io/postgrest.py @@ -94,11 +94,19 @@ def run( "Run PostgREST and yield an endpoint that is ready for connections." with tempfile.TemporaryDirectory() as tmpdir: + + # with python requests, "localhost" doesn't automatically resolves + # to [::1], hence we use this explicitly when host is ipv6 special + # address + ipv6_special_addresses = ["*6", "!6"] + + localhost = "[::1]" if host in ipv6_special_addresses else "localhost" + if port: env["PGRST_SERVER_PORT"] = str(port) - env["PGRST_SERVER_HOST"] = host or "localhost" + env["PGRST_SERVER_HOST"] = host or localhost # When constructing IPv6 address, host address should be bracketed like [host] - apihost = f"[{host}]" if host and is_ipv6(host) else "localhost" + apihost = f"[{host}]" if host and is_ipv6(host) else localhost baseurl = f"http://{apihost}:{port}" else: socketfile = pathlib.Path(tmpdir) / "postgrest.sock" @@ -107,7 +115,7 @@ def run( adminport = freeport(port) env["PGRST_ADMIN_SERVER_PORT"] = str(adminport) - adminhost = f"[{host}]" if host and is_ipv6(host) else "localhost" + adminhost = f"[{host}]" if host and is_ipv6(host) else localhost adminurl = f"http://{adminhost}:{adminport}" command = [POSTGREST_BIN]