Skip to content

Commit

Permalink
fixed ows hostname for WCS GetCaps (#545)
Browse files Browse the repository at this point in the history
  • Loading branch information
edisonguo committed Aug 31, 2021
1 parent 497d28f commit ecb89a9
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 20 deletions.
2 changes: 1 addition & 1 deletion ows.go
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,7 @@ func serveWCS(ctx context.Context, params utils.WCSParams, conf *utils.Config, r
}

tpl, _ := fileResolver.Lookup("templates/WCS_GetCapabilities.tpl")
err := utils.ExecuteWriteTemplateFile(w, &conf, tpl)
err := utils.ExecuteWriteTemplateFile(w, &newConf, tpl)
if err != nil {
metricsCollector.Info.HTTPStatus = 500
http.Error(w, err.Error(), 500)
Expand Down
40 changes: 21 additions & 19 deletions utils/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -1203,25 +1203,27 @@ func (config *Config) Copy(r *http.Request) *Config {
continue
}
newConf.Layers[i] = Layer{
Name: layer.Name,
Title: layer.Title,
Abstract: layer.Abstract,
NameSpace: layer.NameSpace,
OWSHostname: layer.OWSHostname,
OWSProtocol: newConf.ServiceConfig.OWSProtocol,
Styles: layer.Styles,
AxesInfo: layer.AxesInfo,
StepDays: layer.StepDays,
StepHours: layer.StepHours,
StepMinutes: layer.StepMinutes,
StartISODate: layer.StartISODate,
EndISODate: layer.EndISODate,
TimeGen: layer.TimeGen,
Accum: layer.Accum,
DataSource: layer.DataSource,
RGBExpressions: layer.RGBExpressions,
TimestampToken: layer.TimestampToken,
Dates: layer.Dates,
Name: layer.Name,
Title: layer.Title,
Abstract: layer.Abstract,
NameSpace: layer.NameSpace,
OWSHostname: layer.OWSHostname,
OWSProtocol: newConf.ServiceConfig.OWSProtocol,
Styles: layer.Styles,
AxesInfo: layer.AxesInfo,
StepDays: layer.StepDays,
StepHours: layer.StepHours,
StepMinutes: layer.StepMinutes,
StartISODate: layer.StartISODate,
EndISODate: layer.EndISODate,
TimeGen: layer.TimeGen,
Accum: layer.Accum,
DataSource: layer.DataSource,
RGBExpressions: layer.RGBExpressions,
TimestampToken: layer.TimestampToken,
Dates: layer.Dates,
EffectiveStartDate: layer.EffectiveStartDate,
EffectiveEndDate: layer.EffectiveEndDate,
}
if !hasOWSHostname {
newConf.Layers[i].OWSHostname = r.Host
Expand Down

0 comments on commit ecb89a9

Please sign in to comment.