Skip to content

Commit

Permalink
imp - sec - Use HTTPS everywhere
Browse files Browse the repository at this point in the history
---

As we're in the world where HTTPS is more secure than HTTP, we need to use HTTPS in both OWM and TWC weather endpoints.

---

Type: imp
Breaking: False
Doc Required: False
Part: 1/1
  • Loading branch information
AptiviCEO committed Jun 12, 2024
1 parent b028be5 commit 163c7d7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
8 changes: 4 additions & 4 deletions Nettify/Weather/WeatherForecast.cs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public static class WeatherForecast
/// <returns>A class containing properties of weather information</returns>
public static WeatherForecastInfo GetWeatherInfo(double latitude, double longitude, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
{
string WeatherURL = $"http://api.weather.com/v3/wx/forecast/daily/15day?geocode={latitude},{longitude}&format=json&language=en-US&units={(Unit == UnitMeasurement.Metric ? 'm' : 'e')}&apiKey={APIKey}";
string WeatherURL = $"https://api.weather.com/v3/wx/forecast/daily/15day?geocode={latitude},{longitude}&format=json&language=en-US&units={(Unit == UnitMeasurement.Metric ? 'm' : 'e')}&apiKey={APIKey}";
return GetWeatherInfo(WeatherURL, Unit == UnitMeasurement.Kelvin ? UnitMeasurement.Imperial : Unit);
}

Expand Down Expand Up @@ -82,7 +82,7 @@ internal static WeatherForecastInfo GetWeatherInfo(string WeatherURL, UnitMeasur
/// <returns>A class containing properties of weather information</returns>
public static async Task<WeatherForecastInfo> GetWeatherInfoAsync(double latitude, double longitude, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
{
string WeatherURL = $"http://api.weather.com/v3/wx/forecast/daily/15day?geocode={latitude},{longitude}&format=json&language=en-US&units={(Unit == UnitMeasurement.Metric ? 'm' : 'e')}&apiKey={APIKey}";
string WeatherURL = $"https://api.weather.com/v3/wx/forecast/daily/15day?geocode={latitude},{longitude}&format=json&language=en-US&units={(Unit == UnitMeasurement.Metric ? 'm' : 'e')}&apiKey={APIKey}";
return await GetWeatherInfoAsync(WeatherURL, Unit);
}

Expand Down Expand Up @@ -262,7 +262,7 @@ T Adjust<T>(string dayPartData)
/// </summary>
public static Dictionary<string, (double, double)> ListAllCities(string city, string APIKey)
{
string WeatherCityListURL = $"http://api.weather.com/v3/location/search?language=en-US&query={city}&format=json&apiKey={APIKey}";
string WeatherCityListURL = $"https://api.weather.com/v3/location/search?language=en-US&query={city}&format=json&apiKey={APIKey}";
Stream WeatherCityListDataStream;
Debug.WriteLine("Weather City List URL: {0}", WeatherCityListURL);

Expand All @@ -278,7 +278,7 @@ T Adjust<T>(string dayPartData)
/// </summary>
public static async Task<Dictionary<string, (double, double)>> ListAllCitiesAsync(string city, string APIKey)
{
string WeatherCityListURL = $"http://api.weather.com/v3/location/search?language=en-US&query={city}&format=json&apiKey={APIKey}";
string WeatherCityListURL = $"https://api.weather.com/v3/location/search?language=en-US&query={city}&format=json&apiKey={APIKey}";
Stream WeatherCityListDataStream;
Debug.WriteLine("Weather City List URL: {0}", WeatherCityListURL);

Expand Down
12 changes: 6 additions & 6 deletions Nettify/Weather/WeatherForecastOwm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public static class WeatherForecastOwm
/// <returns>A class containing properties of weather information</returns>
public static WeatherForecastInfo GetWeatherInfo(long CityID, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
{
string WeatherURL = $"http://api.openweathermap.org/data/2.5/weather?id={CityID}&appid={APIKey}";
string WeatherURL = $"https://api.openweathermap.org/data/2.5/weather?id={CityID}&appid={APIKey}";
return GetWeatherInfo(WeatherURL, Unit);
}

Expand All @@ -57,7 +57,7 @@ public static WeatherForecastInfo GetWeatherInfo(long CityID, string APIKey, Uni
/// <returns>A class containing properties of weather information</returns>
public static WeatherForecastInfo GetWeatherInfo(string CityName, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
{
string WeatherURL = $"http://api.openweathermap.org/data/2.5/weather?q={CityName}&appid={APIKey}";
string WeatherURL = $"https://api.openweathermap.org/data/2.5/weather?q={CityName}&appid={APIKey}";
return GetWeatherInfo(WeatherURL, Unit);
}

Expand Down Expand Up @@ -94,7 +94,7 @@ internal static WeatherForecastInfo GetWeatherInfo(string WeatherURL, UnitMeasur
/// <returns>A class containing properties of weather information</returns>
public static async Task<WeatherForecastInfo> GetWeatherInfoAsync(long CityID, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
{
string WeatherURL = $"http://api.openweathermap.org/data/2.5/weather?id={CityID}&appid={APIKey}";
string WeatherURL = $"https://api.openweathermap.org/data/2.5/weather?id={CityID}&appid={APIKey}";
return await GetWeatherInfoAsync(WeatherURL, Unit);
}

Expand All @@ -107,7 +107,7 @@ public static async Task<WeatherForecastInfo> GetWeatherInfoAsync(long CityID, s
/// <returns>A class containing properties of weather information</returns>
public static async Task<WeatherForecastInfo> GetWeatherInfoAsync(string CityName, string APIKey, UnitMeasurement Unit = UnitMeasurement.Metric)
{
string WeatherURL = $"http://api.openweathermap.org/data/2.5/weather?q={CityName}&appid={APIKey}";
string WeatherURL = $"https://api.openweathermap.org/data/2.5/weather?q={CityName}&appid={APIKey}";
return await GetWeatherInfoAsync(WeatherURL, Unit);
}

Expand Down Expand Up @@ -152,7 +152,7 @@ internal static WeatherForecastInfo FinalizeInstallation(JToken WeatherToken, Un
/// </summary>
public static Dictionary<long, string> ListAllCities()
{
string WeatherCityListURL = $"http://bulk.openweathermap.org/sample/city.list.json.gz";
string WeatherCityListURL = $"https://bulk.openweathermap.org/sample/city.list.json.gz";
Stream WeatherCityListDataStream;
Debug.WriteLine("Weather City List URL: {0}", WeatherCityListURL);

Expand All @@ -166,7 +166,7 @@ public static Dictionary<long, string> ListAllCities()
/// </summary>
public static async Task<Dictionary<long, string>> ListAllCitiesAsync()
{
string WeatherCityListURL = $"http://bulk.openweathermap.org/sample/city.list.json.gz";
string WeatherCityListURL = $"https://bulk.openweathermap.org/sample/city.list.json.gz";
Stream WeatherCityListDataStream;
Debug.WriteLine("Weather City List URL: {0}", WeatherCityListURL);

Expand Down

0 comments on commit 163c7d7

Please sign in to comment.