user-agent on http POST requests

merge-requests/237/merge
Tag 2023-02-16 12:40:12 -08:00
rodzic 2d6d2ed3b9
commit a3f14a2e2f
3 zmienionych plików z 18 dodań i 26 usunięć

Wyświetl plik

@ -2913,7 +2913,9 @@ function getPostJSONBuffer(
method: "post",
headers: {
"Content-Type": "application/json",
"Content-Length": postData.length
"Content-Length": postData.length,
"User-Agent": gtUserAgent,
"x-user-agent": gtUserAgent
}
};
var req = http.request(options, function (res)

Wyświetl plik

@ -5100,6 +5100,8 @@ function createGlobalHeatmapLayer(name, radius, blur)
g_layerSources[name] = new ol.source.Vector({});
g_layerVectors[name] = new ol.layer.Heatmap({
source: g_layerSources[name],
blur: 20,
radius: 15,
zIndex: Object.keys(g_layerVectors).length + 1
});
g_layerVectors[name].set("name", name);
@ -6580,7 +6582,6 @@ var g_decodeCollector = {};
function handleWsjtxDecode(newMessage)
{
if (g_ignoreMessages == 1 || g_map == null) return;
var didAlert = false;
var didCustomAlert = false;
var validQTH = false;
@ -6601,13 +6602,15 @@ function handleWsjtxDecode(newMessage)
}
var theTimeStamp = timeNowSec() - (timeNowSec() % 86400) + parseInt(newMessage.TM / 1000);
var theMessage = newMessage.Msg;
// Break up the decoded message
var decodeWords = newMessage.Msg.split(" ").slice(0, 5);
var decodeWords = theMessage.split(" ").slice(0, 5);
while (decodeWords[decodeWords.length - 1] == "") decodeWords.pop();
if (decodeWords.length > 1)
{
if (newMessage.Msg.indexOf("<") != -1)
if (theMessage.indexOf("<") != -1)
{
for (const i in decodeWords)
{
@ -6875,29 +6878,15 @@ function handleWsjtxDecode(newMessage)
if (newMessage.NW)
{
didCustomAlert = processAlertMessage(
decodeWords,
newMessage.Msg.substr(0, 30).trim(),
callsign.band,
callsign.mode
);
didCustomAlert = processAlertMessage(decodeWords, theMessage.substr(0, 30).trim(), callsign.band, callsign.mode);
didAlert = checkClassicAlerts(CQ, callsign, newMessage, msgDXcallsign);
insertMessageInRoster(
newMessage,
msgDEcallsign,
msgDXcallsign,
callsign,
hash
);
insertMessageInRoster(newMessage, msgDEcallsign, msgDXcallsign, callsign, hash);
if (
g_mapSettings.trafficDecode &&
(didAlert == true || didCustomAlert == true)
)
if (g_mapSettings.trafficDecode && (didAlert == true || didCustomAlert == true))
{
var traffic = htmlEntities(newMessage.Msg);
var traffic = htmlEntities(theMessage);
if (didAlert == true)
{
traffic = "⚠️ " + traffic;
@ -7161,7 +7150,7 @@ function handleWsjtxDecode(newMessage)
"</td><td style='color:" +
(CQ ? "cyan" : "white") +
"'>" +
htmlEntities(newMessage.Msg) +
htmlEntities(theMessage) +
"</td><td style='color:yellow'>" +
countryName +
"</td></tr>"
@ -12249,7 +12238,9 @@ function getPostBuffer(
method: "post",
headers: {
"Content-Type": "application/x-www-form-urlencoded",
"Content-Length": postData.length
"Content-Length": postData.length,
"User-Agent": gtUserAgent,
"x-user-agent": gtUserAgent
}
};
var req = http.request(options, function (res)

Wyświetl plik

@ -9,14 +9,13 @@ function renderCompactRosterHeaders()
function renderCompactRosterRow(callObj, showBand)
{
var ID = callObj.DEcall + callObj.band + callObj.mode;
var title = callObj.RSTsent + "&#13256;, " + parseInt(callObj.dt * 100) + "ms, " + callObj.delta + "hz" + (callObj.grid.length ? ", " + callObj.grid : "") + ", " + (timeNowSec() - callObj.age).toDHMS();
var bandView = showBand ? "<div style='color: #" + window.opener.g_pskColors[callObj.band] + ";float:right;display:inline-block;'>" + callObj.band + "</div>" : "";
if (g_rosterSettings.compactEntity == "Band")
{
bandView = "";
}
var onClick = " onClick='initiateQso(\"" + ID + "\")' id='" + ID + "' title='" + title + "' ";
var onClick = " onClick='initiateQso(\"" + callObj.hash + "\")' id='" + callObj.hash + "' title='" + title + "' ";
var wholeClick = (g_isCompactCounty ? "" : onClick);
var callsignClick = (g_isCompactCounty ? onClick : "");
var worker = "<div class='compact' " + wholeClick + " >";