mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 19:22:24 -05:00
[bugfix] Convert IDNs to punycode before using as session name (#458)
* convert hostname to punycode for session name * test punycode
This commit is contained in:
parent
af97d6bb7e
commit
7883dd5499
2 changed files with 18 additions and 1 deletions
|
|
@ -82,6 +82,15 @@ func (suite *SessionTestSuite) TestDeriveSessionOK() {
|
|||
suite.Equal("gotosocial-example.org", sessionName)
|
||||
}
|
||||
|
||||
func (suite *SessionTestSuite) TestDeriveSessionIDNOK() {
|
||||
viper.Set(config.Keys.Protocol, "https")
|
||||
viper.Set(config.Keys.Host, "fóid.org")
|
||||
|
||||
sessionName, err := router.SessionName()
|
||||
suite.NoError(err)
|
||||
suite.Equal("gotosocial-xn--fid-gna.org", sessionName)
|
||||
}
|
||||
|
||||
func TestSessionTestSuite(t *testing.T) {
|
||||
suite.Run(t, &SessionTestSuite{})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue