Skip to content

Commit

Permalink
Prevent item creation from non-official service endpoints
Browse files Browse the repository at this point in the history
  • Loading branch information
defagos committed Dec 12, 2024
1 parent 11c6ca8 commit 8a38a04
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions Sources/CoreBusiness/DataProvider/Server.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,13 @@ public struct Server {
private let baseUrl: URL
private let queryItems: [URLQueryItem]

/// Creates a server with custom settings.
/// This API will be removed in a future Pillarbox release. Do not use.
///
/// - Parameters:
/// - baseUrl: The base URL of the server.
/// - queryItems: Additional query items to associate with each request.
///
/// Useful for servers which can exactly pose as SRG SSR servers and deliver the same playback metadata format and
/// image scaling capabilities.
/// > Warning: This API will be removed in a future Pillarbox release. Do not use.
public init(baseUrl: URL, queryItems: [URLQueryItem] = []) {
// FIXME: This initializer must be made private after SAM replaces the IL. The assertion must be removed at
// the same time.
assert(Bundle.main.bundleIdentifier!.hasPrefix("ch.srgssr.Pillarbox-demo"), "This API will be removed in a future Pillarbox release. Do not use.")
self.baseUrl = baseUrl
self.queryItems = queryItems
}
Expand Down

0 comments on commit 8a38a04

Please sign in to comment.