8000 fix: comments · shyim/symfony-cli@0d5967b · GitHub
[go: up one dir, main page]

Skip to content 8000

Commit 0d 8000 5967b

Browse files
committed
fix: comments
1 parent 1a13418 commit 0d5967b

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

commands/local_server_start.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ var localServerStartCmd = &console.Command{
6767
&console.BoolFlag{Name: "no-humanize", Usage: "Do not format JSON logs"},
6868
&console.StringFlag{Name: "p12", Usage: "Name of the file containing the TLS certificate to use in p12 format"},
6969
&console.BoolFlag{Name: "no-tls", Usage: "Use HTTP instead of HTTPS"},
70-
&console.BoolFlag{Name: "use-gzip", Usage: "Use GZIP", DefaultValue: false},
70+
&console.BoolFlag{Name: "use-gzip", Usage: "Use GZIP"},
7171
},
7272
Action: func(c *console.Context) error {
7373
ui := terminal.SymfonyStyle(terminal.Stdout, terminal.Stdin)

local/http/http.go

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,9 +66,13 @@ var gzipContentTypes = []string{
6666
"text/csv",
6767
"text/javascript",
6868
"text/css",
69+
"text/xml",
6970
"application/json",
7071
"application/javascript",
7172
"application/vnd.api+json",
73+
"application/atom+xml",
74+
"application/rss+xml",
75+
"image/svg+xml",
7276
}
7377

7478
// Start starts the server
@@ -79,17 +83,17 @@ func (s *Server) Start(errChan chan error) (int, error) {
7983
}
8084
s.serverPort = strconv.Itoa(port)
8185

82-
gzipWrapper, err := gziphandler.GzipHandlerWithOpts(gziphandler.ContentTypes(gzipContentTypes))
83-
84-
if err != nil {
85-
return port, err
86-
}
87-
8886
var proxyHandler http.Handler
8987

9088
proxyHandler = http.HandlerFunc(s.ProxyHandler)
9189

9290
if s.UseGzip {
91+
gzipWrapper, err := gziphandler.GzipHandlerWithOpts(gziphandler.ContentTypes(gzipContentTypes))
92+
93+
if err != nil {
94+
return port, errors.WithStack(err)
95+
}
96+
9397
proxyHandler = gzipWrapper(proxyHandler)
9498
}
9599

0 commit comments

Comments
 (0)
0