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
bbf954cb
Commit
bbf954cb
authored
Sep 20, 2016
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix case sensitivity in site addresses
parent
73916ccc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
3 deletions
+4
-3
caddyhttp/httpserver/plugin.go
caddyhttp/httpserver/plugin.go
+4
-3
No files found.
caddyhttp/httpserver/plugin.go
View file @
bbf954cb
...
@@ -65,7 +65,7 @@ type httpContext struct {
...
@@ -65,7 +65,7 @@ type httpContext struct {
func
(
h
*
httpContext
)
saveConfig
(
key
string
,
cfg
*
SiteConfig
)
{
func
(
h
*
httpContext
)
saveConfig
(
key
string
,
cfg
*
SiteConfig
)
{
h
.
siteConfigs
=
append
(
h
.
siteConfigs
,
cfg
)
h
.
siteConfigs
=
append
(
h
.
siteConfigs
,
cfg
)
h
.
keysToSiteConfigs
[
key
]
=
cfg
h
.
keysToSiteConfigs
[
strings
.
ToLower
(
key
)
]
=
cfg
}
}
// InspectServerBlocks make sure that everything checks out before
// InspectServerBlocks make sure that everything checks out before
...
@@ -171,13 +171,14 @@ func (h *httpContext) MakeServers() ([]caddy.Server, error) {
...
@@ -171,13 +171,14 @@ func (h *httpContext) MakeServers() ([]caddy.Server, error) {
// new, empty one will be created.
// new, empty one will be created.
func
GetConfig
(
c
*
caddy
.
Controller
)
*
SiteConfig
{
func
GetConfig
(
c
*
caddy
.
Controller
)
*
SiteConfig
{
ctx
:=
c
.
Context
()
.
(
*
httpContext
)
ctx
:=
c
.
Context
()
.
(
*
httpContext
)
if
cfg
,
ok
:=
ctx
.
keysToSiteConfigs
[
c
.
Key
];
ok
{
key
:=
strings
.
ToLower
(
c
.
Key
)
if
cfg
,
ok
:=
ctx
.
keysToSiteConfigs
[
key
];
ok
{
return
cfg
return
cfg
}
}
// we should only get here during tests because directive
// we should only get here during tests because directive
// actions typically skip the server blocks where we make
// actions typically skip the server blocks where we make
// the configs
// the configs
ctx
.
saveConfig
(
c
.
K
ey
,
&
SiteConfig
{
Root
:
Root
,
TLS
:
new
(
caddytls
.
Config
)})
ctx
.
saveConfig
(
k
ey
,
&
SiteConfig
{
Root
:
Root
,
TLS
:
new
(
caddytls
.
Config
)})
return
GetConfig
(
c
)
return
GetConfig
(
c
)
}
}
...
...
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