Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PP-813] Send more detailed user agent #380

Merged
merged 4 commits into from
Jan 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 10 additions & 4 deletions Palace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -630,6 +630,8 @@
E5180ABA29A91D42002A18F8 /* AdaptableGridLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5180AB929A91D42002A18F8 /* AdaptableGridLayout.swift */; };
E5180ABB29A91D42002A18F8 /* AdaptableGridLayout.swift in Sources */ = {isa = PBXBuildFile; fileRef = E5180AB929A91D42002A18F8 /* AdaptableGridLayout.swift */; };
E51818442927FD8E00C03AD5 /* Strings.swift in Sources */ = {isa = PBXBuildFile; fileRef = E54DD4CF275C66F30013C200 /* Strings.swift */; };
E51919D82B508EE400C08E86 /* URLRequest+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E51919D72B508EE400C08E86 /* URLRequest+Extensions.swift */; };
E51919D92B50902000C08E86 /* URLRequest+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E51919D72B508EE400C08E86 /* URLRequest+Extensions.swift */; };
E51EB51529D5F46400022D24 /* String+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E57E798329D4D407006D0F87 /* String+Extensions.swift */; };
E523124B285C3828007D1DB5 /* TPPBookRegistry+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = E523124A285C3828007D1DB5 /* TPPBookRegistry+Extensions.swift */; };
E523124D28641505007D1DB5 /* LoadingViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = E523124C28641505007D1DB5 /* LoadingViewController.swift */; };
Expand Down Expand Up @@ -1555,6 +1557,7 @@
E5024A8E2A0EB9D6006BF653 /* AudiobookBookmarkBusinessLogicTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudiobookBookmarkBusinessLogicTests.swift; sourceTree = "<group>"; };
E5037FE629A3FF83002DA132 /* ButtonStateTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ButtonStateTests.swift; sourceTree = "<group>"; };
E5180AB929A91D42002A18F8 /* AdaptableGridLayout.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AdaptableGridLayout.swift; sourceTree = "<group>"; };
E51919D72B508EE400C08E86 /* URLRequest+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "URLRequest+Extensions.swift"; sourceTree = "<group>"; };
E523116928504B85007D1DB5 /* TPPBook+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TPPBook+Extensions.swift"; sourceTree = "<group>"; };
E5231240285C291D007D1DB5 /* AudioBookmark.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AudioBookmark.swift; sourceTree = "<group>"; };
E523124A285C3828007D1DB5 /* TPPBookRegistry+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "TPPBookRegistry+Extensions.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -2457,6 +2460,7 @@
085D31DE1BE3CD3C007F7672 /* NSURLRequest+NYPLURLRequestAdditions.m */,
7340DA6124B7E45C00361387 /* URLResponse+NYPL.swift */,
E7498A7D2A0E4F6A0037DD93 /* URL+Extensions.swift */,
E51919D72B508EE400C08E86 /* URLRequest+Extensions.swift */,
);
path = Networking;
sourceTree = "<group>";
Expand Down Expand Up @@ -4170,6 +4174,7 @@
217595DE27B680D400BA0FDD /* TPPReaderSettingsVC.swift in Sources */,
E7862A252773927900BE8AB8 /* Font+Extensions.swift in Sources */,
73EB0B2125821DF4006BC997 /* TPPLocalization.m in Sources */,
E51919D92B50902000C08E86 /* URLRequest+Extensions.swift in Sources */,
73D8D27D25A68D4300DF5F69 /* TPPReaderTOCBusinessLogic.swift in Sources */,
73EB0B2225821DF4006BC997 /* TPPSecrets.swift in Sources */,
E50D684426AB235400F1042B /* TPPReaderTOCCell.swift in Sources */,
Expand Down Expand Up @@ -4531,6 +4536,7 @@
E73549DE28A53982001B0D0A /* TPPPDFPageBookmark.swift in Sources */,
E53573DC2965E606008BDCA4 /* TPPMyBooksViewController.swift in Sources */,
73B501C524F48D4C00FBAD7D /* TPPUserAccountFrontEndValidation.swift in Sources */,
E51919D82B508EE400C08E86 /* URLRequest+Extensions.swift in Sources */,
E501710F27A3948C004B3392 /* TPPBookmarkFactory.swift in Sources */,
E5180ABA29A91D42002A18F8 /* AdaptableGridLayout.swift in Sources */,
);
Expand Down Expand Up @@ -4776,7 +4782,7 @@
CODE_SIGN_IDENTITY = "Apple Distribution";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 231;
CURRENT_PROJECT_VERSION = 232;
DEVELOPMENT_TEAM = 88CBA74T8K;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -4834,7 +4840,7 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR;
CODE_SIGN_ENTITLEMENTS = Palace/SimplyE.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 231;
CURRENT_PROJECT_VERSION = 232;
DEVELOPMENT_TEAM = 88CBA74T8K;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -5018,7 +5024,7 @@
CODE_SIGN_IDENTITY = "Apple Development";
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "Apple Distribution";
CODE_SIGN_STYLE = Manual;
CURRENT_PROJECT_VERSION = 231;
CURRENT_PROJECT_VERSION = 232;
DEVELOPMENT_TEAM = "";
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K;
ENABLE_BITCODE = NO;
Expand Down Expand Up @@ -5078,7 +5084,7 @@
CLANG_WARN_NON_LITERAL_NULL_CONVERSION = YES_ERROR;
CODE_SIGN_ENTITLEMENTS = Palace/SimplyE.entitlements;
CODE_SIGN_IDENTITY = "iPhone Distribution";
CURRENT_PROJECT_VERSION = 231;
CURRENT_PROJECT_VERSION = 232;
DEVELOPMENT_TEAM = 88CBA74T8K;
"DEVELOPMENT_TEAM[sdk=iphoneos*]" = 88CBA74T8K;
ENABLE_BITCODE = NO;
Expand Down
3 changes: 2 additions & 1 deletion Palace/Accounts/Library/Account+profileDocument.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ extension Account {
return
}

TPPNetworkExecutor.shared.executeRequest(URLRequest(url: profileUrl), useTokenIfAvailable: false) { result in
var request = URLRequest(url: profileUrl)
TPPNetworkExecutor.shared.executeRequest(request.applyCustomUserAgent(), useTokenIfAvailable: false) { result in
switch result {
case .success(let data, _):
do {
Expand Down
2 changes: 2 additions & 0 deletions Palace/Audiobooks/Tracker/AudiobookDataManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,8 @@ class AudiobookDataManager {
request.httpMethod = "POST"
request.httpBody = requestBody
request.setValue("application/json", forHTTPHeaderField: "Content-Type")
request.applyCustomUserAgent()

TPPNetworkExecutor.shared.POST(request, useTokenIfAvailable: true) { result, response, error in
if let response = response as? HTTPURLResponse, !response.isSuccess() {
TPPErrorLogger.logError(error, summary: "Error uploading audiobook tracker data", metadata: [
Expand Down
12 changes: 7 additions & 5 deletions Palace/Book/Models/TPPBookCoverRegistry.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ class TPPBookCoverRegistry {
guard let imageUrl = book.imageURL else {
return
}
urlSession.dataTask(with: URLRequest(url: imageUrl)) { imageData, response, error in
var request = URLRequest(url: imageUrl)
urlSession.dataTask(with: request.applyCustomUserAgent()) { imageData, response, error in
if let imageData = imageData, let image = UIImage(data: imageData) {
DispatchQueue.main.async {
handler(image)
Expand Down Expand Up @@ -74,7 +75,8 @@ class TPPBookCoverRegistry {
result[book.identifier] = self.generateBookCoverImage(book)
return
}
urlSession.dataTask(with: URLRequest(url: thumbnailUrl)) { imageData, response, error in

urlSession.dataTask(with: URLRequest(url: thumbnailUrl, applyingCustomUserAgent: true)) { imageData, response, error in
if let imageData = imageData, let image = UIImage(data: imageData) {
DispatchQueue.main.async {
result[book.identifier] = image
Expand All @@ -93,7 +95,7 @@ class TPPBookCoverRegistry {
/// - Returns: cover image, if one is available.
func cachedThumbnailImageForBook(_ book: TPPBook) -> UIImage? {
guard let thumbnailUrl = book.imageThumbnailURL,
let cachedData = urlSession.configuration.urlCache?.cachedResponse(for: URLRequest(url: thumbnailUrl))?.data
let cachedData = urlSession.configuration.urlCache?.cachedResponse(for: URLRequest(url: thumbnailUrl, applyingCustomUserAgent: true))?.data
else {
return nil
}
Expand All @@ -109,7 +111,7 @@ class TPPBookCoverRegistry {
return
}
try? Data().write(to: fileUrl, options: .atomic)
urlSession.dataTask(with: URLRequest(url: thumbnailUrl)) { imageData, response, error in
urlSession.dataTask(with: URLRequest(url: thumbnailUrl, applyingCustomUserAgent: true)) { imageData, response, error in
if let imageData = imageData {
do {
try imageData.write(to: fileUrl, options: .atomic)
Expand Down Expand Up @@ -194,7 +196,7 @@ class TPPBookCoverRegistry {
/// - handler: completion handler.
/// - book: `TPPBook` object.
private func getBookCoverImage(url: URL, fileUrl: URL?, handler: @escaping (_ image: UIImage?) -> (), forBook book: TPPBook) {
urlSession.dataTask(with: URLRequest(url: url)) { imageData, response, error in
urlSession.dataTask(with: URLRequest(url: url, applyingCustomUserAgent: true)) { imageData, response, error in
if let imageData = imageData, let image = UIImage(data: imageData) {
DispatchQueue.main.async {
handler(image)
Expand Down
8 changes: 7 additions & 1 deletion Palace/Book/UI/TPPBookDetailView.m
Original file line number Diff line number Diff line change
Expand Up @@ -442,7 +442,13 @@ - (void)setupAutolayoutConstraints
if ([self.book showAudiobookToolbar] && self.isShowingSample) {
[self.audiobookSampleToolbar autoPinEdgeToSuperviewEdge:ALEdgeLeft];
[self.audiobookSampleToolbar autoPinEdgeToSuperviewEdge:ALEdgeRight];
[self.audiobookSampleToolbar autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset: TabBarHeight];

CGFloat bottomInset = 0;
if ([UIDevice currentDevice].userInterfaceIdiom != UIUserInterfaceIdiomPad) {
bottomInset = TabBarHeight;
}

[self.audiobookSampleToolbar autoPinEdgeToSuperviewEdge:ALEdgeBottom withInset: bottomInset];
[self.audiobookSampleToolbar autoSetDimension:ALDimensionHeight toSize:SampleToolbarHeight relation:NSLayoutRelationLessThanOrEqual];
[self.audiobookSampleToolbar autoMatchDimension:ALDimensionWidth toDimension:ALDimensionWidth ofView:self];
self.scrollView.contentInset = UIEdgeInsetsMake(0, 0, SampleToolbarHeight, 0);
Expand Down
2 changes: 1 addition & 1 deletion Palace/Logging/TPPCirculationAnalytics.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import Foundation

private class func post(_ event: String, withURL url: URL) -> Void
{
var request = URLRequest(url: url)
var request = URLRequest(url: url, applyingCustomUserAgent: true)
request.httpMethod = "GET"

let dataTask = URLSession.shared.dataTask(with: request) { (data, response, error) in
Expand Down
10 changes: 5 additions & 5 deletions Palace/MyBooks/MyBooksDownloadCenter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,7 @@ import OverdriveProcessor
if let initedRequest = initedRequest {
request = initedRequest
} else if let url = book.defaultAcquisition?.hrefURL {
request = TPPNetworkExecutor.bearerAuthorized(request: URLRequest(url: url))
request = TPPNetworkExecutor.bearerAuthorized(request: URLRequest(url: url, applyingCustomUserAgent: true))
} else {
logInvalidURLRequest(for: book, withState: state, url: nil, request: nil)
return
Expand Down Expand Up @@ -703,9 +703,8 @@ extension MyBooksDownloadCenter: URLSessionDownloadDelegate {
if let data = try? Data(contentsOf: location) {
if let dictionary = TPPJSONObjectFromData(data) as? [String: Any],
let simplifiedBearerToken = MyBooksSimplifiedBearerToken.simplifiedBearerToken(with: dictionary) {
let mutableRequest = NSMutableURLRequest(url: simplifiedBearerToken.location)
var mutableRequest = URLRequest(url: simplifiedBearerToken.location, applyingCustomUserAgent: true)
mutableRequest.setValue("Bearer \(simplifiedBearerToken.accessToken)", forHTTPHeaderField: "Authorization")

let task = session.downloadTask(with: mutableRequest as URLRequest)
bookIdentifierToDownloadInfo[book.identifier] = MyBooksDownloadInfo(
downloadProgress: 0.0,
Expand Down Expand Up @@ -827,7 +826,7 @@ extension MyBooksDownloadCenter: URLSessionTaskDelegate {
var mutableAllHTTPHeaderFields = request.allHTTPHeaderFields ?? [:]
mutableAllHTTPHeaderFields[authorizationKey] = originalAuthorization

var mutableRequest = URLRequest(url: request.url!)
var mutableRequest = URLRequest(url: request.url!, applyingCustomUserAgent: true)
mutableRequest.allHTTPHeaderFields = mutableAllHTTPHeaderFields

completionHandler(mutableRequest)
Expand Down Expand Up @@ -855,7 +854,8 @@ extension MyBooksDownloadCenter: URLSessionTaskDelegate {
}

private func addDownloadTask(with request: URLRequest, book: TPPBook) {
let task = self.session.downloadTask(with: request)
var modifiableRequest = request
let task = self.session.downloadTask(with: modifiableRequest.applyCustomUserAgent())

self.bookIdentifierToDownloadInfo[book.identifier] =
MyBooksDownloadInfo(downloadProgress: 0.0,
Expand Down
2 changes: 1 addition & 1 deletion Palace/Network/BundledHTMLViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import WebKit
}

override func viewWillAppear(_ animated: Bool) {
self.webView.load(URLRequest(url: self.fileURL))
self.webView.load(URLRequest(url: self.fileURL, applyingCustomUserAgent: true))
}

fileprivate class WebViewDelegate: NSObject, WKNavigationDelegate
Expand Down
4 changes: 2 additions & 2 deletions Palace/Network/RemoteHTMLViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ import WebKit
_ = self.navigationController?.popViewController(animated: true)
}
let action2 = UIAlertAction.init(title: Strings.Generic.reload, style: .destructive) { (reloadAction) in
let urlRequest = URLRequest(url: self.fileURL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
webView.load(urlRequest)
var urlRequest = URLRequest(url: self.fileURL, cachePolicy: .useProtocolCachePolicy, timeoutInterval: 10.0)
webView.load(urlRequest.applyCustomUserAgent())
}

alert.addAction(action1)
Expand Down
1 change: 1 addition & 0 deletions Palace/Network/TPPNetworkExecutor.swift
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ extension TPPNetworkExecutor {
var urlRequest = URLRequest(url: url,
cachePolicy: urlSession.configuration.requestCachePolicy)

urlRequest.applyCustomUserAgent()
if let authToken = TPPUserAccount.sharedAccount().authToken, useTokenIfAvailable {
let headers = [
"Authorization" : "Bearer \(authToken)",
Expand Down
1 change: 1 addition & 0 deletions Palace/Network/TPPNetworkQueue.swift
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@ final class NetworkQueue: NSObject {
var urlRequest = URLRequest(url: URL(string: requestRow[sqlUrl])!)
urlRequest.httpMethod = requestRow[sqlMethod]
urlRequest.httpBody = requestRow[sqlParameters]
urlRequest.applyCustomUserAgent()

if let headerData = requestRow[sqlHeader],
let headers = NSKeyedUnarchiver.unarchiveObject(with: headerData) as? [String:String] {
Expand Down
6 changes: 3 additions & 3 deletions Palace/Notifications/NotificationService.swift
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ class NotificationService: NSObject, UNUserNotificationCenterDelegate, Messaging
else {
return
}
var request = URLRequest(url: requestUrl)
let request = URLRequest(url: requestUrl, applyingCustomUserAgent: true)
_ = TPPNetworkExecutor.shared.addBearerAndExecute(request) { result, response, error in
let status = (response as? HTTPURLResponse)?.statusCode
// Token exists if status code is 200, doesn't exist if 404.
Expand All @@ -111,7 +111,7 @@ class NotificationService: NSObject, UNUserNotificationCenterDelegate, Messaging
guard let requestBody = TokenData(token: token).data else {
return
}
var request = URLRequest(url: endpointUrl)
var request = URLRequest(url: endpointUrl, applyingCustomUserAgent: true)
request.httpMethod = "PUT"
request.httpBody = requestBody
_ = TPPNetworkExecutor.shared.addBearerAndExecute(request) { result, response, error in
Expand Down Expand Up @@ -159,7 +159,7 @@ class NotificationService: NSObject, UNUserNotificationCenterDelegate, Messaging
guard let requestBody = TokenData(token: token).data else {
return
}
var request = URLRequest(url: endpointUrl)
var request = URLRequest(url: endpointUrl, applyingCustomUserAgent: true)
request.httpMethod = "DELETE"
request.httpBody = requestBody
_ = TPPNetworkExecutor.shared.addBearerAndExecute(request) { result, response, error in
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ class TPPLicensesService: NSObject {
// Background task identifier is unique to create unique download sessions for each class instance.
// Otherwise, single download session calls one delegate class methods,
// and only one book's status is updated.
let request = URLRequest(url: url)
let request = URLRequest(url: url, applyingCustomUserAgent: true)
let backgroundIdentifier = (Bundle.main.bundleIdentifier ?? "").appending(".lcpBackgroundIdentifier.\(lcpl.hashValue)")
let sessionConfiguration = URLSessionConfiguration.background(withIdentifier: backgroundIdentifier)
let session = URLSession(configuration: sessionConfiguration, delegate: self, delegateQueue: .main)
Expand Down
2 changes: 1 addition & 1 deletion Palace/Samples/Sample.swift
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ extension Sample {
var needsDownload: Bool { type.needsDownload }

func fetchSample(completion: @escaping (NYPLResult<Data>) -> Void) {
let _ = TPPNetworkExecutor.shared.GET(url) { result in
let _ = TPPNetworkExecutor.shared.GET(url, useTokenIfAvailable: false) { result in
completion(result)
}
}
Expand Down
2 changes: 1 addition & 1 deletion Palace/SignInLogic/TPPSignInBusinessLogic.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ class TPPSignInBusinessLogic: NSObject, TPPSignedInStateProvider, TPPCurrentLibr
return nil
}

var req = URLRequest(url: url)
var req = URLRequest(url: url, applyingCustomUserAgent: true)

if let selectedAuth = selectedAuthentication,
(selectedAuth.isOauth || selectedAuth.isSaml) {
Expand Down
2 changes: 1 addition & 1 deletion Palace/SignInLogic/TokenRequest.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ import Foundation
}

func execute() async -> Result<TokenResponse, Error> {
var request = URLRequest(url: url)
var request = URLRequest(url: url, applyingCustomUserAgent: true)
request.httpMethod = HTTPMethodType.POST.rawValue

let loginString = "\(username):\(password)"
Expand Down
43 changes: 43 additions & 0 deletions Palace/Utilities/Networking/URLRequest+Extensions.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
//
// URLRequest+Extensions.swift
// Palace
//
// Created by Maurice Carrier on 1/11/24.
// Copyright © 2024 The Palace Project. All rights reserved.
//

import Foundation

extension URLRequest {
init(url: URL, applyingCustomUserAgent: Bool) {
self.init(url: url)

if applyingCustomUserAgent {
let appName = Bundle.main.infoDictionary?["CFBundleName"] as? String ?? "App"
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
let customUserAgent = "\(appName)/\(appVersion) (iOS; \(UIDevice.current.systemVersion))"

if let existingUserAgent = self.value(forHTTPHeaderField: "User-Agent") {
self.setValue("\(existingUserAgent) \(customUserAgent)", forHTTPHeaderField: "User-Agent")
} else {
self.setValue(customUserAgent, forHTTPHeaderField: "User-Agent")
}
}
}
}

extension URLRequest {
@discardableResult mutating func applyCustomUserAgent() -> URLRequest {
let appName = Bundle.main.infoDictionary?["CFBundleName"] as? String ?? "App"
let appVersion = Bundle.main.infoDictionary?["CFBundleShortVersionString"] as? String ?? "1.0"
let customUserAgent = "\(appName)/\(appVersion) (iOS; \(UIDevice.current.systemVersion))"

if let existingUserAgent = value(forHTTPHeaderField: "User-Agent") {
setValue("\(existingUserAgent) \(customUserAgent)", forHTTPHeaderField: "User-Agent")
} else {
setValue(customUserAgent, forHTTPHeaderField: "User-Agent")
}

return self
}
}
2 changes: 1 addition & 1 deletion ios-audiobook-overdrive