diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2023-01-05 18:32:14 -0500 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2023-01-05 21:29:18 -0500 |
commit | dac5f7e0a513d8cebe8ad2f4161a4c73ba72bee7 (patch) | |
tree | 3a615659691cbe5eb093358aa74b82ab119e978f /pkg/api/api0/api.go | |
parent | e8cea8d07de5caf16f6d0e2e8ec3724b03de1d6a (diff) | |
download | Atlas-dac5f7e0a513d8cebe8ad2f4161a4c73ba72bee7.tar.gz Atlas-dac5f7e0a513d8cebe8ad2f4161a4c73ba72bee7.zip |
pkg/api/api0: Export request version helpers
Diffstat (limited to 'pkg/api/api0/api.go')
-rw-r--r-- | pkg/api/api0/api.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/api/api0/api.go b/pkg/api/api0/api.go index 66f9a93..38d1741 100644 --- a/pkg/api/api0/api.go +++ b/pkg/api/api0/api.go @@ -147,9 +147,9 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { notPanicked = true } -// checkLauncherVersion checks if the r was made by NorthstarLauncher and if it +// CheckLauncherVersion checks if the r was made by NorthstarLauncher and if it // is at least MinimumLauncherVersion. -func (h *Handler) checkLauncherVersion(r *http.Request) bool { +func (h *Handler) CheckLauncherVersion(r *http.Request) bool { rver, _, _ := strings.Cut(r.Header.Get("User-Agent"), " ") if x := strings.TrimPrefix(rver, "R2Northstar/"); rver != x { if len(x) > 0 && x[0] != 'v' { @@ -195,9 +195,9 @@ func (h *Handler) checkLauncherVersion(r *http.Request) bool { return true } -// extractLauncherVersion extracts the launcher version from r, returning an +// ExtractLauncherVersion extracts the launcher version from r, returning an // empty string if it's missing or invalid. -func (h *Handler) extractLauncherVersion(r *http.Request) string { +func (h *Handler) ExtractLauncherVersion(r *http.Request) string { rver, _, _ := strings.Cut(r.Header.Get("User-Agent"), " ") if x := strings.TrimPrefix(rver, "R2Northstar/"); rver != x { if len(x) > 0 && x[0] != 'v' { |