-
Notifications
You must be signed in to change notification settings - Fork 51
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[fix] Fix the problem that the signature method may lose part of the …
…path
- Loading branch information
1 parent
878618d
commit 7741370
Showing
3 changed files
with
53 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -190,7 +190,6 @@ func getLocalIP() string { | |
if ipnet.IP.To4() != nil { | ||
return ipnet.IP.String() | ||
} | ||
|
||
} | ||
} | ||
return "" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
package agollo | ||
|
||
import "testing" | ||
|
||
func Test_getPathWithQuery(t *testing.T) { | ||
type args struct { | ||
uri string | ||
} | ||
tests := []struct { | ||
name string | ||
args args | ||
want string | ||
}{ | ||
{ | ||
name: "", | ||
args: args{ | ||
uri: "http://apollo.meta/configsvc-dev/services/config?id=1", | ||
}, | ||
want: "/configsvc-dev/services/config?id=1", | ||
}, | ||
} | ||
for _, tt := range tests { | ||
t.Run(tt.name, func(t *testing.T) { | ||
if got := getPathWithQuery(tt.args.uri); got != tt.want { | ||
t.Errorf("getPathWithQuery() = %v, want %v", got, tt.want) | ||
} | ||
}) | ||
} | ||
} |