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
81c4ea6b
Commit
81c4ea6b
authored
Jun 20, 2016
by
Mateusz Gajewski
Committed by
Matt Holt
Jun 20, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add support for Alt-Svc headers (#892)
parent
1fdc46e5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
caddyhttp/httpserver/server.go
caddyhttp/httpserver/server.go
+8
-0
No files found.
caddyhttp/httpserver/server.go
View file @
81c4ea6b
...
...
@@ -71,6 +71,7 @@ func NewServer(addr string, group []*SiteConfig) (*Server, error) {
// Enable QUIC if desired
if
QUIC
{
s
.
quicServer
=
&
h2quic
.
Server
{
Server
:
s
.
Server
}
s
.
Server
.
Handler
=
s
.
wrapWithSvcHeaders
(
s
.
Server
.
Handler
)
}
// We have to bound our wg with one increment
...
...
@@ -105,6 +106,13 @@ func NewServer(addr string, group []*SiteConfig) (*Server, error) {
return
s
,
nil
}
func
(
s
*
Server
)
wrapWithSvcHeaders
(
previousHandler
http
.
Handler
)
http
.
HandlerFunc
{
return
func
(
w
http
.
ResponseWriter
,
r
*
http
.
Request
)
{
s
.
quicServer
.
SetQuicHeaders
(
w
.
Header
())
previousHandler
.
ServeHTTP
(
w
,
r
)
}
}
// Listen creates an active listener for s that can be
// used to serve requests.
func
(
s
*
Server
)
Listen
()
(
net
.
Listener
,
error
)
{
...
...
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