Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
caddy
Commits
aebe387f
Commit
aebe387f
authored
Jul 13, 2017
by
Ning Xie
Committed by
Matt Holt
Jul 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
basicauth: remove magic number (#1760)
parent
09850246
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
2 deletions
+3
-2
caddyhttp/basicauth/setup.go
caddyhttp/basicauth/setup.go
+3
-2
No files found.
caddyhttp/basicauth/setup.go
View file @
aebe387f
...
...
@@ -91,8 +91,9 @@ func basicAuthParse(c *caddy.Controller) ([]Rule, error) {
}
func
passwordMatcher
(
username
,
passw
,
siteRoot
string
)
(
PasswordMatcher
,
error
)
{
if
!
strings
.
HasPrefix
(
passw
,
"htpasswd="
)
{
htpasswdPrefix
:=
"htpasswd="
if
!
strings
.
HasPrefix
(
passw
,
htpasswdPrefix
)
{
return
PlainMatcher
(
passw
),
nil
}
return
GetHtpasswdMatcher
(
passw
[
9
:
],
username
,
siteRoot
)
return
GetHtpasswdMatcher
(
passw
[
len
(
htpasswdPrefix
)
:
],
username
,
siteRoot
)
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment