mirror of
https://git.mirrors.martin98.com/https://github.com/jina-ai/reader
synced 2025-08-15 21:15:59 +08:00
fix: geoip encoding
This commit is contained in:
parent
2941be6096
commit
4077fa7040
@ -37,7 +37,7 @@ export class BraveSearchService extends AsyncService {
|
||||
const geoip = await this.geoipControl.lookupCity(ip, GEOIP_SUPPORTED_LANGUAGES.EN);
|
||||
|
||||
if (geoip?.city) {
|
||||
extraHeaders['X-Loc-City'] = geoip.city;
|
||||
extraHeaders['X-Loc-City'] = encodeURIComponent(geoip.city);
|
||||
}
|
||||
if (geoip?.country) {
|
||||
extraHeaders['X-Loc-Country'] = geoip.country.code;
|
||||
@ -50,8 +50,8 @@ export class BraveSearchService extends AsyncService {
|
||||
extraHeaders['X-Loc-Long'] = `${geoip.coordinates[1]}`;
|
||||
}
|
||||
if (geoip?.subdivisions?.length) {
|
||||
extraHeaders['X-Loc-State'] = geoip.subdivisions[0].code;
|
||||
extraHeaders['X-Loc-State-Name'] = geoip.subdivisions[0].name;
|
||||
extraHeaders['X-Loc-State'] = encodeURIComponent(`${geoip.subdivisions[0].code}`);
|
||||
extraHeaders['X-Loc-State-Name'] = encodeURIComponent(`${geoip.subdivisions[0].name}`);
|
||||
}
|
||||
}
|
||||
if (this.threadLocal.get('userAgent')) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user