Security: add nominatim endpoint to config and csp

This commit is contained in:
Pieter Vander Vennet 2023-09-29 11:13:30 +02:00
parent 477ef56e00
commit 451aa3bcd4
4 changed files with 8 additions and 3 deletions

View file

@ -1,5 +1,6 @@
import { Utils } from "../../Utils"
import { BBox } from "../BBox"
import Constants from "../../Models/Constants"
export interface GeoCodeResult {
display_name: string
@ -15,7 +16,7 @@ export interface GeoCodeResult {
}
export class Geocoding {
private static readonly host = "https://nominatim.openstreetmap.org/search?"
public static readonly host = Constants.nominatimEndpoint
static async Search(query: string, bbox: BBox): Promise<GeoCodeResult[]> {
const b = bbox ?? BBox.global

View file

@ -107,7 +107,7 @@ export default class Constants {
public static defaultOverpassUrls = Constants.config.default_overpass_urls
public static countryCoderEndpoint: string = Constants.config.country_coder_host
public static osmAuthConfig: AuthConfig = Constants.config.oauth_credentials
public static nominatimEndpoint: string = Constants.config.nominatimEndpoint
/**
* These are the values that are allowed to use as 'backdrop' icon for a map pin
*/