mirror of
https://github.com/MichMich/MagicMirror.git
synced 2025-06-28 09:42:21 -04:00
Fix rounding in precipitation percentage (#3045)
Percentage should be always rounded so that we dont get something like "47.0000000001 %" Some small typo and naming fixes also while I am here --------- Co-authored-by: veeck <michael@veeck.de>
This commit is contained in:
parent
390e5d6490
commit
6d86ffade4
6 changed files with 21 additions and 19 deletions
|
@ -14,7 +14,7 @@ function getConfig(req, res) {
|
|||
}
|
||||
|
||||
/**
|
||||
* A method that forewards HTTP Get-methods to the internet to avoid CORS-errors.
|
||||
* A method that forwards HTTP Get-methods to the internet to avoid CORS-errors.
|
||||
*
|
||||
* Example input request url: /cors?sendheaders=header1:value1,header2:value2&expectedheaders=header1,header2&url=http://www.test.com/path?param1=value1
|
||||
*
|
||||
|
@ -26,7 +26,7 @@ function getConfig(req, res) {
|
|||
async function cors(req, res) {
|
||||
try {
|
||||
const urlRegEx = "url=(.+?)$";
|
||||
let url = "";
|
||||
let url;
|
||||
|
||||
const match = new RegExp(urlRegEx, "g").exec(req.url);
|
||||
if (!match) {
|
||||
|
@ -56,7 +56,7 @@ async function cors(req, res) {
|
|||
}
|
||||
|
||||
/**
|
||||
* Gets headers and values to attatch to the web request.
|
||||
* Gets headers and values to attach to the web request.
|
||||
*
|
||||
* @param {string} url - The url containing the headers and values to send.
|
||||
* @returns {object} An object specifying name and value of the headers.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue