fix(server): allow to pass actual source version to flux proxy
parent
54e2b358c8
commit
f6b8a7b2ad
|
@ -137,7 +137,8 @@ func (s *Service) ProxyFlux(w http.ResponseWriter, r *http.Request) {
|
|||
return
|
||||
}
|
||||
|
||||
path := r.URL.Query().Get("path")
|
||||
query := r.URL.Query()
|
||||
path := query.Get("path")
|
||||
if path == "" {
|
||||
Error(w, http.StatusUnprocessableEntity, "path query parameter required", s.Logger)
|
||||
return
|
||||
|
@ -149,6 +150,12 @@ func (s *Service) ProxyFlux(w http.ResponseWriter, r *http.Request) {
|
|||
notFound(w, id, s.Logger)
|
||||
return
|
||||
}
|
||||
version := query.Get("version")
|
||||
if version != "" {
|
||||
// the client knows the actual version of the source, the sources
|
||||
// return from the server always go live to re-fetch their versions
|
||||
src.Version = version
|
||||
}
|
||||
|
||||
fluxEnabled, err := hasFlux(ctx, src)
|
||||
if err != nil {
|
||||
|
|
Loading…
Reference in New Issue