Skip to content

Commit 5a733e8

Browse files
fix(x/upgrade): Stop treating inline JSON as a URL (#19706)
Co-authored-by: Julien Robert <julien@rbrt.fr>
1 parent 6b1e9fc commit 5a733e8

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

x/upgrade/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
3737

3838
* [#19443](https://github.com/cosmos/cosmos-sdk/pull/19443) `NewKeeper` takes an `appmodule.Environment` instead of individual services.
3939

40+
### Bug Fixes
41+
42+
* [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL.
43+
4044
## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.1) - 2023-12-11
4145

4246
### Improvements

x/upgrade/plan/info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ func ParseInfo(infoStr string, opts ...ParseOption) (*Info, error) {
5454
}
5555

5656
// If it's a url, download it and treat the result as the real info.
57-
if _, err := neturl.Parse(infoStr); err == nil {
57+
if _, err := neturl.ParseRequestURI(infoStr); err == nil {
5858
if err := ValidateURL(infoStr, parseConfig.EnforceChecksum); err != nil {
5959
return nil, err
6060
}

x/upgrade/plan/info_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,12 @@ func (s *InfoTestSuite) TestParseInfo() {
7676
expectedInfo: nil,
7777
expectedInError: []string{"plan info must not be blank"},
7878
},
79+
{
80+
name: "empty JSON",
81+
infoStrMaker: makeInfoStrFuncString("{}"),
82+
expectedInfo: &Info{},
83+
expectedInError: nil,
84+
},
7985
{
8086
name: "json binaries is wrong data type",
8187
infoStrMaker: makeInfoStrFuncString(binariesWrongJSON),

0 commit comments

Comments
 (0)