mirror of
https://github.com/zulip/zulip-desktop.git
synced 2025-11-13 10:26:15 +00:00
request: Send user-agent with request.
We now send the user-agent with the request. Fixes #611.
This commit is contained in:
@@ -12,6 +12,7 @@ const Logger = require('./logger-util');
|
|||||||
const CertificateUtil = require(__dirname + '/certificate-util.js');
|
const CertificateUtil = require(__dirname + '/certificate-util.js');
|
||||||
const ProxyUtil = require(__dirname + '/proxy-util.js');
|
const ProxyUtil = require(__dirname + '/proxy-util.js');
|
||||||
const ConfigUtil = require(__dirname + '/config-util.js');
|
const ConfigUtil = require(__dirname + '/config-util.js');
|
||||||
|
const SystemUtil = require(__dirname + '/../utils/system-util.js');
|
||||||
|
|
||||||
const logger = new Logger({
|
const logger = new Logger({
|
||||||
file: `domain-util.log`,
|
file: `domain-util.log`,
|
||||||
@@ -130,7 +131,8 @@ class DomainUtil {
|
|||||||
url: domain + '/static/audio/zulip.ogg',
|
url: domain + '/static/audio/zulip.ogg',
|
||||||
ca: (certificateLocation) ? certificateLocation : '',
|
ca: (certificateLocation) ? certificateLocation : '',
|
||||||
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
|
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
|
||||||
ecdhCurve: 'auto'
|
ecdhCurve: 'auto',
|
||||||
|
headers: { 'User-Agent': SystemUtil.getUserAgent() }
|
||||||
};
|
};
|
||||||
|
|
||||||
const serverConf = {
|
const serverConf = {
|
||||||
@@ -221,7 +223,8 @@ class DomainUtil {
|
|||||||
url: domain + '/api/v1/server_settings',
|
url: domain + '/api/v1/server_settings',
|
||||||
ca: (certificateLocation) ? certificateLocation : '',
|
ca: (certificateLocation) ? certificateLocation : '',
|
||||||
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
|
proxy: proxyEnabled ? ProxyUtil.getProxy(domain) : '',
|
||||||
ecdhCurve: 'auto'
|
ecdhCurve: 'auto',
|
||||||
|
headers: { 'User-Agent': SystemUtil.getUserAgent() }
|
||||||
};
|
};
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
request(serverSettingsOptions, (error, response) => {
|
request(serverSettingsOptions, (error, response) => {
|
||||||
@@ -266,7 +269,8 @@ class DomainUtil {
|
|||||||
url,
|
url,
|
||||||
ca: (certificateLocation) ? certificateLocation : '',
|
ca: (certificateLocation) ? certificateLocation : '',
|
||||||
proxy: proxyEnabled ? ProxyUtil.getProxy(url) : '',
|
proxy: proxyEnabled ? ProxyUtil.getProxy(url) : '',
|
||||||
ecdhCurve: 'auto'
|
ecdhCurve: 'auto',
|
||||||
|
headers: { 'User-Agent': SystemUtil.getUserAgent() }
|
||||||
};
|
};
|
||||||
|
|
||||||
// The save will always succeed. If url is invalid, downgrade to default icon.
|
// The save will always succeed. If url is invalid, downgrade to default icon.
|
||||||
|
|||||||
Reference in New Issue
Block a user