Skip to content

Commit 0df2902

Browse files
mergify[bot]gibson042tac0turtle
authored
fix(x/upgrade): Stop treating inline JSON as a URL (backport #19706) (#19767)
Co-authored-by: Richard Gibson <richard.gibson@gmail.com> Co-authored-by: marbar3778 <marbar3778@yahoo.com>
1 parent 9a59234 commit 0df2902

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
@@ -25,6 +25,10 @@ Ref: https://keepachangelog.com/en/1.0.0/
2525

2626
## [Unreleased]
2727

28+
### Bug Fixes
29+
30+
* [#19706](https://github.com/cosmos/cosmos-sdk/pull/19706) Stop treating inline JSON as a URL.
31+
2832
## [v0.1.1](https://github.com/cosmos/cosmos-sdk/releases/tag/x/upgrade/v0.1.1) - 2023-12-11
2933

3034
### 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
@@ -74,6 +74,12 @@ func (s *InfoTestSuite) TestParseInfo() {
7474
expectedInfo: nil,
7575
expectedInError: []string{"plan info must not be blank"},
7676
},
77+
{
78+
name: "empty JSON",
79+
infoStrMaker: makeInfoStrFuncString("{}"),
80+
expectedInfo: &Info{},
81+
expectedInError: nil,
82+
},
7783
{
7884
name: "json binaries is wrong data type",
7985
infoStrMaker: makeInfoStrFuncString(binariesWrongJSON),

0 commit comments

Comments
 (0)