Allow --fallback as sole format option
This commit is contained in:
parent
f21594feef
commit
aa6cb2aeef
|
@ -12,7 +12,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
const (
|
||||||
ReleaseVersion string = "3.2.9"
|
ReleaseVersion string = "3.2.10"
|
||||||
)
|
)
|
||||||
|
|
||||||
var (
|
var (
|
||||||
|
@ -119,7 +119,7 @@ func init() {
|
||||||
|
|
||||||
rootCmd.CompletionOptions.HiddenDefaultCmd = true
|
rootCmd.CompletionOptions.HiddenDefaultCmd = true
|
||||||
|
|
||||||
rootCmd.MarkFlagsOneRequired("all", "audio", "code", "flash", "images", "text", "video")
|
rootCmd.MarkFlagsOneRequired("all", "audio", "code", "fallback", "flash", "images", "text", "video")
|
||||||
|
|
||||||
rootCmd.SilenceErrors = true
|
rootCmd.SilenceErrors = true
|
||||||
rootCmd.SetHelpCommand(&cobra.Command{
|
rootCmd.SetHelpCommand(&cobra.Command{
|
||||||
|
|
|
@ -135,12 +135,12 @@ func realIP(r *http.Request) string {
|
||||||
|
|
||||||
remotePort := remoteAddr[len(remoteAddr)-1]
|
remotePort := remoteAddr[len(remoteAddr)-1]
|
||||||
|
|
||||||
cfIP := r.Header.Get("Cf-Connecting-Ip")
|
cfIp := r.Header.Get("Cf-Connecting-Ip")
|
||||||
xRealIp := r.Header.Get("X-Real-Ip")
|
xRealIp := r.Header.Get("X-Real-Ip")
|
||||||
|
|
||||||
switch {
|
switch {
|
||||||
case cfIP != "":
|
case cfIp != "":
|
||||||
return cfIP + ":" + remotePort
|
return cfIp + ":" + remotePort
|
||||||
case xRealIp != "":
|
case xRealIp != "":
|
||||||
return xRealIp + ":" + remotePort
|
return xRealIp + ":" + remotePort
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -88,7 +88,6 @@ func serveStaticFile(paths []string, index *fileIndex, errorChannel chan<- error
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
if !exists {
|
if !exists {
|
||||||
notFound(w, r, filePath)
|
notFound(w, r, filePath)
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue