1
0
Fork 0

Enhance REST provider

This commit is contained in:
Daniel Tomcej 2019-07-12 17:24:03 -06:00 committed by Traefiker Bot
parent 48d98dcf45
commit 51486b18fa
5 changed files with 94 additions and 40 deletions

View file

@ -48,7 +48,7 @@ func (p *Provider) Append(systemRouter *mux.Router) {
return
}
configuration := new(dynamic.HTTPConfiguration)
configuration := new(dynamic.Configuration)
body, _ := ioutil.ReadAll(request.Body)
if err := json.Unmarshal(body, configuration); err != nil {
@ -57,9 +57,7 @@ func (p *Provider) Append(systemRouter *mux.Router) {
return
}
p.configurationChan <- dynamic.Message{ProviderName: "rest", Configuration: &dynamic.Configuration{
HTTP: configuration,
}}
p.configurationChan <- dynamic.Message{ProviderName: "rest", Configuration: configuration}
if err := templatesRenderer.JSON(response, http.StatusOK, configuration); err != nil {
log.WithoutContext().Error(err)
}