]> source.dussan.org Git - gitea.git/commit
Fix panic in BasicAuthDecode (#14046)
authorsilverwind <me@silverwind.io>
Fri, 18 Dec 2020 01:51:28 +0000 (02:51 +0100)
committerGitHub <noreply@github.com>
Fri, 18 Dec 2020 01:51:28 +0000 (20:51 -0500)
commit27edc1aa19afb043a497a7dc628afa420cb1de55
tree620ac8b6ab3b181da86efbbe1d459cf66ab0a954
parente9cc613c245fa15cc8d8e3e3e98573a212c73aa4
Fix panic in BasicAuthDecode (#14046)

* Fix panic in BasicAuthDecode

If the string does not contain ":" that function would run into an
`index out of range [1] with length 1` error. prevent that.

* Update BasicAuthDecode()

Co-authored-by: 6543 <6543@obermui.de>
modules/base/tool.go
modules/base/tool_test.go