Blame SOURCES/0004-metno-Use-GNOME-specific-subdomain.patch

3584c8
From d304e911d09d52b763f2c11a4309d170d0597a86 Mon Sep 17 00:00:00 2001
3584c8
From: Bastien Nocera <hadess@hadess.net>
3584c8
Date: Tue, 12 Jan 2021 14:21:21 +0100
3584c8
Subject: [PATCH 4/7] metno: Use GNOME-specific subdomain
3584c8
3584c8
This allows the API provider to track libgweather usage.
3584c8
---
3584c8
 libgweather/weather-yrno.c | 5 ++++-
3584c8
 1 file changed, 4 insertions(+), 1 deletion(-)
3584c8
3584c8
diff --git a/libgweather/weather-yrno.c b/libgweather/weather-yrno.c
3584c8
index 7a46fbae..13ee8537 100644
3584c8
--- a/libgweather/weather-yrno.c
3584c8
+++ b/libgweather/weather-yrno.c
3584c8
@@ -37,6 +37,9 @@
3584c8
 
3584c8
 #define XC(t) ((const xmlChar *)(t))
3584c8
 
3584c8
+/* As per https://gitlab.gnome.org/GNOME/libgweather/-/issues/59#note_1004747 */
3584c8
+#define API_ENDPOINT_DOMAIN "aa037rv1tsaszxi6o.api.met.no"
3584c8
+
3584c8
 /* Reference for symbols at https://api.met.no/weatherapi/weathericon/2.0/ */
3584c8
 typedef struct {
3584c8
     int code;
3584c8
@@ -594,7 +597,7 @@ yrno_start_open_new (GWeatherInfo *info)
3584c8
     g_ascii_dtostr (latstr, sizeof(latstr), RADIANS_TO_DEGREES (loc->latitude));
3584c8
     g_ascii_dtostr (lonstr, sizeof(lonstr), RADIANS_TO_DEGREES (loc->longitude));
3584c8
 
3584c8
-    url = g_strdup_printf("https://api.met.no/weatherapi/locationforecast/2.0/classic?lat=%s;lon=%s", latstr, lonstr);
3584c8
+    url = g_strdup_printf("https://" API_ENDPOINT_DOMAIN "/weatherapi/locationforecast/2.0/classic?lat=%s;lon=%s", latstr, lonstr);
3584c8
 
3584c8
     message = soup_message_new ("GET", url);
3584c8
     _gweather_info_begin_request (info, message);
3584c8
-- 
3584c8
2.30.2
3584c8