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
01266ece
Commit
01266ece
authored
Mar 20, 2015
by
Matthew Holt
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Minor style nit-pick
parent
1b7415a8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
11 deletions
+10
-11
config/middleware.go
config/middleware.go
+10
-11
No files found.
config/middleware.go
View file @
01266ece
...
...
@@ -17,6 +17,7 @@ import (
// This init function registers middleware. Register middleware
// in the order they should be executed during a request.
// Middleware execute in this order: A-B-C-*-C-B-A
// assuming they call the Next handler in the chain.
func
init
()
{
register
(
"gzip"
,
gzip
.
New
)
register
(
"header"
,
headers
.
New
)
...
...
@@ -30,17 +31,15 @@ func init() {
register
(
"markdown"
,
markdown
.
New
)
}
var
(
// registry stores the registered middleware:
// both the order and the directives to which they
// are bound.
registry
=
struct
{
directiveMap
map
[
string
]
middleware
.
Generator
ordered
[]
string
}{
directiveMap
:
make
(
map
[
string
]
middleware
.
Generator
),
}
)
// registry stores the registered middleware:
// both the order and the directives to which they
// are bound.
var
registry
=
struct
{
directiveMap
map
[
string
]
middleware
.
Generator
ordered
[]
string
}{
directiveMap
:
make
(
map
[
string
]
middleware
.
Generator
),
}
// register binds a middleware generator (outer function)
// to a directive. Upon each request, middleware will be
...
...
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