Allow --fallback as sole format option
This commit is contained in:
parent
f21594feef
commit
aa6cb2aeef
|
@ -12,7 +12,7 @@ import (
|
|||
)
|
||||
|
||||
const (
|
||||
ReleaseVersion string = "3.2.9"
|
||||
ReleaseVersion string = "3.2.10"
|
||||
)
|
||||
|
||||
var (
|
||||
|
@ -119,7 +119,7 @@ func init() {
|
|||
|
||||
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.SetHelpCommand(&cobra.Command{
|
||||
|
|
|
@ -135,12 +135,12 @@ func realIP(r *http.Request) string {
|
|||
|
||||
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")
|
||||
|
||||
switch {
|
||||
case cfIP != "":
|
||||
return cfIP + ":" + remotePort
|
||||
case cfIp != "":
|
||||
return cfIp + ":" + remotePort
|
||||
case xRealIp != "":
|
||||
return xRealIp + ":" + remotePort
|
||||
default:
|
||||
|
|
|
@ -88,7 +88,6 @@ func serveStaticFile(paths []string, index *fileIndex, errorChannel chan<- error
|
|||
|
||||
return
|
||||
}
|
||||
|
||||
if !exists {
|
||||
notFound(w, r, filePath)
|
||||
|
||||
|
|
Loading…
Reference in New Issue