From 43965bc452feba73f412fee087eab276cf16beb6 Mon Sep 17 00:00:00 2001 From: Richard Gibson Date: Fri, 15 Mar 2024 20:34:49 -0400 Subject: [PATCH] fix(x/upgrade): Stop treating inline JSON as a URL (#19706) Co-authored-by: Julien Robert (cherry picked from commit 5a733e81dce237fb379f6b8d9c624f1768ca03c6) # Conflicts: # x/upgrade/CHANGELOG.md --- x/upgrade/CHANGELOG.md | 19 +++++++++++++++++++ x/upgrade/plan/info.go | 2 +- x/upgrade/plan/info_test.go | 6 ++++++ 3 files changed, 26 insertions(+), 1 deletion(-) diff --git a/x/upgrade/CHANGELOG.md b/x/upgrade/CHANGELOG.md index 8b652c3a0da2..1b2045b2bf94 100644 --- a/x/upgrade/CHANGELOG.md +++ b/x/upgrade/CHANGELOG.md @@ -25,6 +25,25 @@ Ref: https://keepachangelog.com/en/1.0.0/ ## [Unreleased] +<<<<<<< HEAD +======= +### Improvements + +* [#19672](https://github.com/cosmos/cosmos-sdk/pull/19672) Follow latest `cosmossdk.io/core` `PreBlock` simplification. + +### State Machine Breaking + +* (x/upgrade) [#16244](https://github.com/cosmos/cosmos-sdk/pull/16244) Upgrade module no longer stores the app version but gets and sets the app version stored in the `ParamStore` of baseapp. + +### API Breaking Changes + +* [#19443](https://github.com/cosmos/cosmos-sdk/pull/19443) `NewKeeper` takes an `appmodule.Environment` instead of individual services. + +### Bug Fixes + +* [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL. + +>>>>>>> 5a733e81d (fix(x/upgrade): Stop treating inline JSON as a URL (#19706)) ## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.1) - 2023-12-11 ### Improvements diff --git a/x/upgrade/plan/info.go b/x/upgrade/plan/info.go index 545991c71b94..5ad692d3b18e 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 b9b89e369ec3..48432935dbe2 100644 --- a/x/upgrade/plan/info_test.go +++ b/x/upgrade/plan/info_test.go @@ -74,6 +74,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),