mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-08 04:06:18 -04:00
25 lines
381 B
Go
25 lines
381 B
Go
|
|
package web
|
||
|
|
|
||
|
|
import "net/http"
|
||
|
|
|
||
|
|
const (
|
||
|
|
sourceOpenF1 = "openf1"
|
||
|
|
sourceLocal = "local"
|
||
|
|
sourceAuto = "auto"
|
||
|
|
)
|
||
|
|
|
||
|
|
func parseSourceMode(r *http.Request) string {
|
||
|
|
switch r.URL.Query().Get("source") {
|
||
|
|
case sourceLocal:
|
||
|
|
return sourceLocal
|
||
|
|
case sourceAuto:
|
||
|
|
return sourceAuto
|
||
|
|
default:
|
||
|
|
return sourceOpenF1
|
||
|
|
}
|
||
|
|
}
|
||
|
|
|
||
|
|
func (s *Server) hasLocalQuery() bool {
|
||
|
|
return s.query != nil
|
||
|
|
}
|