From 892c4e43cf3685e91d7e1d7f2ab8d73c62027b68 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Thu, 7 Mar 2024 12:53:43 -0500 Subject: [PATCH 1/2] fix(x/upgrade): Stop treating inline JSON as a URL Fix #19686 --- CHANGELOG.md | 1 + x/upgrade/plan/info.go | 2 +- x/upgrade/plan/info_test.go | 6 ++++++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7b610eb219f0..f4b7bddbb259 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,6 +94,7 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (simulation) [#18196](https://github.com/cosmos/cosmos-sdk/pull/18196) Fix the problem of `validator set is empty after InitGenesis` in simulation test. * (baseapp) [#18551](https://github.com/cosmos/cosmos-sdk/pull/18551) Fix SelectTxForProposal the calculation method of tx bytes size is inconsistent with CometBFT * (server) [#18994](https://github.com/cosmos/cosmos-sdk/pull/18994) Update server context directly rather than a reference to a sub-object +* (x/upgrade) [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL. ### API Breaking Changes diff --git a/x/upgrade/plan/info.go b/x/upgrade/plan/info.go index d05c985b5419..6f132032d96d 100644 --- a/x/upgrade/plan/info.go +++ b/x/upgrade/plan/info.go @@ -54,7 +54,7 @@ func ParseInfo(infoStr string, opts ...ParseOption) (*Info, error) { } // If it's a url, download it and treat the result as the real info. - if _, err := neturl.Parse(infoStr); err == nil { + if _, err := neturl.ParseRequestURI(infoStr); err == nil { if err := ValidateURL(infoStr, parseConfig.EnforceChecksum); err != nil { return nil, err } diff --git a/x/upgrade/plan/info_test.go b/x/upgrade/plan/info_test.go index c74b4e48437e..047cd49defa6 100644 --- a/x/upgrade/plan/info_test.go +++ b/x/upgrade/plan/info_test.go @@ -76,6 +76,12 @@ func (s *InfoTestSuite) TestParseInfo() { expectedInfo: nil, expectedInError: []string{"plan info must not be blank"}, }, + { + name: "empty JSON", + infoStrMaker: makeInfoStrFuncString("{}"), + expectedInfo: &Info{}, + expectedInError: nil, + }, { name: "json binaries is wrong data type", infoStrMaker: makeInfoStrFuncString(binariesWrongJSON), From 0cbf9d1008df873b48be75023939a666a089ea78 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Tue, 12 Mar 2024 22:46:34 -0400 Subject: [PATCH 2/2] docs: Move module-specific changelog update to the right place --- CHANGELOG.md | 1 - x/upgrade/CHANGELOG.md | 4 ++++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4b7bddbb259..7b610eb219f0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -94,7 +94,6 @@ Every module contains its own CHANGELOG.md. Please refer to the module you are i * (simulation) [#18196](https://github.com/cosmos/cosmos-sdk/pull/18196) Fix the problem of `validator set is empty after InitGenesis` in simulation test. * (baseapp) [#18551](https://github.com/cosmos/cosmos-sdk/pull/18551) Fix SelectTxForProposal the calculation method of tx bytes size is inconsistent with CometBFT * (server) [#18994](https://github.com/cosmos/cosmos-sdk/pull/18994) Update server context directly rather than a reference to a sub-object -* (x/upgrade) [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL. ### API Breaking Changes diff --git a/x/upgrade/CHANGELOG.md b/x/upgrade/CHANGELOG.md index 7ff56275c000..a2c65fa19bf1 100644 --- a/x/upgrade/CHANGELOG.md +++ b/x/upgrade/CHANGELOG.md @@ -33,6 +33,10 @@ Ref: https://keepachangelog.com/en/1.0.0/ * [#19443](https://github.com/cosmos/cosmos-sdk/pull/19443) Creation of upgrade module receives `appmodule.Environment` instead of individual services +### Bug Fixes + +* [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL. + ## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.1) - 2023-12-11 ### Improvements