mirror of
https://github.com/AmanTahiliani/box-box.git
synced 2026-08-07 19:56:18 -04:00
Add local-first race hub API
This commit is contained in:
24
internal/web/source.go
Normal file
24
internal/web/source.go
Normal file
@@ -0,0 +1,24 @@
|
||||
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
|
||||
}
|
||||
Reference in New Issue
Block a user