|
@@ -30,8 +30,14 @@ PLEASE ALWAYS USE URLENCODE IN THE LINK PASSED INTO THE /media ENDPOINT
|
|
//
|
|
//
|
|
|
|
|
|
func mediaServer_init() {
|
|
func mediaServer_init() {
|
|
- http.HandleFunc("/media/", gzipmiddleware.CompressFunc(serverMedia))
|
|
|
|
- http.HandleFunc("/media/getMime/", gzipmiddleware.CompressFunc(serveMediaMime))
|
|
|
|
|
|
+ if *enable_gzip {
|
|
|
|
+ http.HandleFunc("/media/", gzipmiddleware.CompressFunc(serverMedia))
|
|
|
|
+ http.HandleFunc("/media/getMime/", gzipmiddleware.CompressFunc(serveMediaMime))
|
|
|
|
+ } else {
|
|
|
|
+ http.HandleFunc("/media/", serverMedia)
|
|
|
|
+ http.HandleFunc("/media/getMime/", serveMediaMime)
|
|
|
|
+ }
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
//This function validate the incoming media request and return the real path for the targed file
|
|
//This function validate the incoming media request and return the real path for the targed file
|