Skip to content
Snippets Groups Projects
Commit 377d9b44 authored by rithu leena john's avatar rithu leena john Committed by GitHub
Browse files

Merge pull request #985 from zlabjp/avoid-id-beginning-with-number

bugfix: avoid generating an invalid ID attribute in SAML's AuthenRequest element
parents a5d218fd cc314690
No related branches found
No related tags found
No related merge requests found
......@@ -30,8 +30,8 @@ func NewID() string {
if _, err := io.ReadFull(rand.Reader, buff); err != nil {
panic(err)
}
// Trim padding
return strings.TrimRight(encoding.EncodeToString(buff), "=")
// Avoid the identifier to begin with number and trim padding
return string(buff[0]%26+'a') + strings.TrimRight(encoding.EncodeToString(buff[1:]), "=")
}
// GCResult returns the number of objects deleted by garbage collection.
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment