mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2025-08-12 06:26:36 +00:00
Move modules to Modules folder.
This commit is contained in:
26
Modules/RSWeb/Sources/RSWeb/UserAgent.swift
Executable file
26
Modules/RSWeb/Sources/RSWeb/UserAgent.swift
Executable file
@@ -0,0 +1,26 @@
|
||||
//
|
||||
// UserAgent.swift
|
||||
// RSWeb
|
||||
//
|
||||
// Created by Brent Simmons on 8/27/16.
|
||||
// Copyright © 2016 Ranchero Software, LLC. All rights reserved.
|
||||
//
|
||||
|
||||
import Foundation
|
||||
|
||||
public struct UserAgent {
|
||||
|
||||
public static func fromInfoPlist() -> String? {
|
||||
|
||||
return Bundle.main.object(forInfoDictionaryKey: "UserAgent") as? String
|
||||
}
|
||||
|
||||
public static func headers() -> [AnyHashable: String]? {
|
||||
|
||||
guard let userAgent = fromInfoPlist() else {
|
||||
return nil
|
||||
}
|
||||
|
||||
return [HTTPRequestHeader.userAgent: userAgent]
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user