@@ -39,6 +39,7 @@ type ProxySettings struct {
3939 ExtScriptTypes []string `json:"extScriptTypes"`
4040 ExtIndexTypes []string `json:"extIndexTypes"`
4141 ExtMimeTypes map [string ]string `json:"extMimeTypes"`
42+ ExtGzippeddTypes []string `json:"extGzippedTypes"`
4243 UseMad4FP bool `json:"useMad4FP"`
4344 LegacyGoPort string `json:"legacyGoPort"`
4445 LegacyPHPPort string `json:"legacyPHPPort"`
@@ -156,12 +157,34 @@ func setContentType(r *http.Request, resp *http.Response) {
156157 if ext != "" {
157158 resp .Header .Set ("Content-Type" , proxySettings .ExtMimeTypes [ext [1 :]])
158159 mime = proxySettings .ExtMimeTypes [ext [1 :]]
160+ if mime != "" {
161+ resp .Header .Set ("Content-Type" , mime )
162+ e := ext [1 :]
163+ // If pre-compressed set encoding type
164+ for _ , element := range proxySettings .ExtGzippeddTypes {
165+ if element == e {
166+ resp .Header .Set ("Content-Encoding" , "gzip" )
167+ break // String found, no need to continue iterating
168+ }
169+ }
170+ }
159171 }
160172
161173 // If the response has an extension, try and fetch the mime for that via extension
162174 if mime == "" && rext != "" {
163175 resp .Header .Set ("Content-Type" , proxySettings .ExtMimeTypes [rext [1 :]])
164176 mime = proxySettings .ExtMimeTypes [rext [1 :]]
177+ if mime != "" {
178+ resp .Header .Set ("Content-Type" , mime )
179+ e := ext [1 :]
180+ // If pre-compressed set encoding type
181+ for _ , element := range proxySettings .ExtGzippeddTypes {
182+ if element == e {
183+ resp .Header .Set ("Content-Encoding" , "gzip" )
184+ break // String found, no need to continue iterating
185+ }
186+ }
187+ }
165188 }
166189
167190 // Set content type header
0 commit comments