mirror of
https://github.com/matrix-org/dendrite.git
synced 2025-12-10 16:33:11 -06:00
more review comments!
This commit is contained in:
parent
7fa2005c94
commit
c4d34db748
|
|
@ -310,6 +310,7 @@ func (config *Dendrite) check() error {
|
|||
|
||||
func absPath(dir string, path Path) string {
|
||||
if filepath.IsAbs(string(path)) {
|
||||
// filepath.Join cleans the path so we should clean the absolute paths as well for consistency.
|
||||
return filepath.Clean(string(path))
|
||||
}
|
||||
return filepath.Join(dir, string(path))
|
||||
|
|
|
|||
|
|
@ -74,15 +74,17 @@ func TestReadKey(t *testing.T) {
|
|||
if err != nil {
|
||||
t.Error("failed to load private key:", err)
|
||||
}
|
||||
wantKeyID := "ed25519:c8NsuQ"
|
||||
wantKeyID := testKeyID
|
||||
if wantKeyID != string(keyID) {
|
||||
t.Errorf("wanted key ID to be %q, got %q", wantKeyID, keyID)
|
||||
}
|
||||
}
|
||||
|
||||
const testKeyID = "ed25519:c8NsuQ"
|
||||
|
||||
const testKey = `
|
||||
-----BEGIN MATRIX PRIVATE KEY-----
|
||||
Key-ID: ed25519:c8NsuQ
|
||||
Key-ID: ` + testKeyID + `
|
||||
7KRZiZ2sTyRR8uqqUjRwczuwRXXkUMYIUHq4Mc3t4bE=
|
||||
-----END MATRIX PRIVATE KEY-----
|
||||
`
|
||||
|
|
|
|||
Loading…
Reference in a new issue