show error when specified map provider is not current provider when using map image proxy

This commit is contained in:
MaysWind
2023-10-29 14:47:18 +08:00
parent 2984980a54
commit d18e8211ca
3 changed files with 13 additions and 0 deletions
+4
View File
@@ -32,6 +32,10 @@ func (p *MapImageProxy) MapTileImageProxyHandler(c *core.Context) (*httputil.Rev
mapProvider := strings.Replace(c.Query("provider"), "-", "_", -1)
targetUrl := ""
if mapProvider != settings.Container.Current.MapProvider {
return nil, errs.ErrMapProviderNotCurrent
}
if mapProvider == settings.OpenStreetMapProvider {
targetUrl = openStreetMapTileImageUrlFormat
} else if mapProvider == settings.OpenStreetMapHumanitarianStyleProvider {