Update http: to https:

This commit is contained in:
An Trinh 2021-06-12 08:45:41 +01:00
parent c86abb0d49
commit 6007b74d2d
5 changed files with 19 additions and 19 deletions

View file

@ -21,8 +21,8 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
defaults: [
"Lock_Wallpaper": "Wallpaper_1",
"Home_Wallpaper": "Wallpaper_1",
"bookmarks": ["http://apple.com":"Apple", "http://yahoo.com":"Yahoo!", "http://google.com":"Google", "https://manuals.info.apple.com/MANUALS/1000/MA1539/en_US/iPhone_iOS4_User_Guide.pdf":"iPhone User Guide", "https://web.archive.org/web/20100814131917/http://www.apple.com/webapps/":"iPhone Web Applications", "http://zsk.dev":"Zane K — My place on the internet"],
"webpages": ["0":"http://google.com", "1":"http://zsk.dev"], //Saving like this let's us get around NSKeyedArchiver
"bookmarks": ["https://apple.com":"Apple", "https://yahoo.com":"Yahoo!", "https://google.com":"Google", "https://manuals.info.apple.com/MANUALS/1000/MA1539/en_US/iPhone_iOS4_User_Guide.pdf":"iPhone User Guide", "https://web.archive.org/web/20100814131917/https://www.apple.com/webapps/":"iPhone Web Applications", "https://zsk.dev":"Zane K — My place on the internet"],
"webpages": ["0":"https://google.com", "1":"https://zsk.dev"], //Saving like this let's us get around NSKeyedArchiver
"weather_cities": ["0":"Cupertino,us", "1": "New York,us"],
"weather_mode": "imperial",
"stock_mode": "Price",

View file

@ -338,7 +338,7 @@ struct app_store_categories: View {
}
func fetch_first_image_for_category(id: String, completion: @escaping (URL) -> Void) {
let paid_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/sf=143441/genre=\(id)/xml")!
let paid_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/sf=143441/genre=\(id)/xml")!
let paid_parser = FeedParser(URL: paid_url)
paid_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {
@ -531,7 +531,7 @@ struct category_destination: View {
DispatchQueue.main.async {
//Top Free
let id = selected_category.genre_id
let free_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topfreeapplications/sf=143441/limit=25/genre=\(id)/xml")!
let free_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topfreeapplications/sf=143441/limit=25/genre=\(id)/xml")!
let free_parser = FeedParser(URL: free_url)
free_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {
@ -552,7 +552,7 @@ struct category_destination: View {
}
}
//Top Paid
let paid_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/sf=143441/limit=25/genre=\(id)/xml")!
let paid_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/toppaidapplications/sf=143441/limit=25/genre=\(id)/xml")!
let paid_parser = FeedParser(URL: paid_url)
paid_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {
@ -574,7 +574,7 @@ struct category_destination: View {
}
}
//Most Recent
let new_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/newapplications/sf=143441/limit=25/genre=\(id)/xml")!
let new_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/newapplications/sf=143441/limit=25/genre=\(id)/xml")!
let new_parser = FeedParser(URL: new_url)
new_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {

View file

@ -39,7 +39,7 @@ struct Safari: View {
init() {
let userDefaults = UserDefaults.standard
var webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"http://"]).sorted(by: >)
var webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"https://"]).sorted(by: >)
if webpages.count > 1 {
for i in 0..<(webpages.count-1) {
views.array.append(WebViewStore())
@ -113,7 +113,7 @@ struct Safari: View {
webpage_dict["\(i)"] = (item.webView.url?.relativeString != nil ? item.webView.url?.relativeString : "http")
i += 1
}
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"http://"]).sorted(by: >)
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"https://"]).sorted(by: >)
if defaults_webpages != webpage_dict.sorted(by: >) {
userDefaults.setValue(webpage_dict, forKey: "webpages")
}
@ -130,7 +130,7 @@ struct Safari: View {
webpage_dict["\(i)"] = (item.webView.url?.relativeString != nil ? item.webView.url?.relativeString : "http")
i += 1
}
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"http://"]).sorted(by: >)
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"https://"]).sorted(by: >)
if defaults_webpages != webpage_dict.sorted(by: >) {
userDefaults.setValue(webpage_dict, forKey: "webpages")
}
@ -293,7 +293,7 @@ struct Safari: View {
webpage_dict["\(i)"] = (item.webView.url?.relativeString != nil ? item.webView.url?.relativeString : "http")
i += 1
}
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"http://"]).sorted(by: >)
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"https://"]).sorted(by: >)
if defaults_webpages != webpage_dict.sorted(by: >) {
userDefaults.setValue(webpage_dict, forKey: "webpages")
}
@ -308,7 +308,7 @@ struct Safari: View {
webpage_dict["\(i)"] = (item.webView.url?.relativeString != nil ? item.webView.url?.relativeString : "http")
i += 1
}
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"http://"]).sorted(by: >)
var defaults_webpages = (userDefaults.object(forKey: "webpages") as? [String:String] ?? ["0":"https://"]).sorted(by: >)
if defaults_webpages != webpage_dict.sorted(by: >) {
userDefaults.setValue(webpage_dict, forKey: "webpages")
}
@ -909,16 +909,16 @@ struct url_search_bar: View {
}
}
}) {
if url_search.starts(with: "http://") || url_search.starts(with: "https://") {
if url_search.starts(with: "https://") || url_search.starts(with: "https://") {
guard let url = URL(string: "\(url_search)") else { return }
self.webViewStore.webView.load(URLRequest(url: url))
url_search = self.webViewStore.webView.url?.relativeString ?? ""
} else if url_search.contains("www") {
guard let url = URL(string: "http://\(url_search)") else { return }
guard let url = URL(string: "https://\(url_search)") else { return }
self.webViewStore.webView.load(URLRequest(url: url))
url_search = self.webViewStore.webView.url?.relativeString ?? ""
} else {
guard let url = URL(string: "http://\(url_search)") else { return }
guard let url = URL(string: "https://\(url_search)") else { return }
self.webViewStore.webView.load(URLRequest(url: url))
url_search = self.webViewStore.webView.url?.relativeString ?? ""
//searchTextOnGoogle(urlString)

View file

@ -657,7 +657,7 @@ class WeatherObserver: ObservableObject, Identifiable, Equatable {
}()
func parse_forcast_data(location: String, mode: String) {
guard let location_string = location.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) else {return}
let developed_string = "http://api.openweathermap.org/data/2.5/forecast/daily?q=\(location_string),us&appid=a0bf715940b65a3c9874e2127ec00ed4&units=\(mode)&cnt=6"
let developed_string = "https://api.openweathermap.org/data/2.5/forecast/daily?q=\(location_string),us&appid=a0bf715940b65a3c9874e2127ec00ed4&units=\(mode)&cnt=6"
let forcast_url = URL(string: developed_string)!
let request = URLRequest(url: forcast_url)
let task = URLSession.shared.dataTask(with: request, completionHandler: { (data, response, error) -> Void in
@ -691,7 +691,7 @@ class WeatherObserver: ObservableObject, Identifiable, Equatable {
func parse_current_data(location: String, mode: String) {
guard let location_string = location.addingPercentEncoding(withAllowedCharacters: .urlHostAllowed) else {return}
//There's a very odd SwiftUI bug where if we properly format the url, it will fail to update our image header. This url will essentially be (location),(country),(country), instead of (location),(country). Why this happens is beyond me.
let developed_string = "http://api.openweathermap.org/data/2.5/weather?q=\(location_string),us&appid=a0bf715940b65a3c9874e2127ec00ed4&units=\(mode)"
let developed_string = "https://api.openweathermap.org/data/2.5/weather?q=\(location_string),us&appid=a0bf715940b65a3c9874e2127ec00ed4&units=\(mode)"
let current_url = URL(string: developed_string)!
print(current_url)
let request = URLRequest(url: current_url)

View file

@ -364,7 +364,7 @@ struct itunes_category_destination_view: View {
}.padding([.top, .bottom], 12).onAppear() {
//Top Songs
let id = selected_category.genre_id
let songs_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/sf=143441/genre=\(id)/xml")!
let songs_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topsongs/sf=143441/genre=\(id)/xml")!
let songs_parser = FeedParser(URL: songs_url)
songs_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {
@ -385,7 +385,7 @@ struct itunes_category_destination_view: View {
}
//Top Albums
let albums_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topalbums/sf=143441/genre=\(id)/xml")!
let albums_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topalbums/sf=143441/genre=\(id)/xml")!
let albums_parser = FeedParser(URL: albums_url)
albums_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {
@ -1267,7 +1267,7 @@ func fetch_musicvideo_data(_ video: RSSFeedItem, completion: @escaping (Music_Da
func fetch_first_image_for_top_songs_category(id: String, completion: @escaping (URL) -> Void) {
let paid_url = URL(string: "http://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topalbums/sf=143441/genre=\(id)/xml")!
let paid_url = URL(string: "https://ax.itunes.apple.com/WebObjects/MZStoreServices.woa/ws/RSS/topalbums/sf=143441/genre=\(id)/xml")!
let paid_parser = FeedParser(URL: paid_url)
paid_parser.parseAsync(queue: DispatchQueue.global(qos: .userInitiated)) { (result) in
DispatchQueue.main.async {