Skip to content

Commit

Permalink
Merge pull request #13 from ForgeRock/SDKS-3603-x-requested-with
Browse files Browse the repository at this point in the history
Update the x-requested-with header in SDK requests from forgerock-sdk  to ping-sdk
  • Loading branch information
spetrov authored Dec 6, 2024
2 parents 1aed15b + b1d6e4a commit 2f42bc6
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Davinci/Davinci/Davinci.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ extension DaVinci {
public static func createDaVinci(block: (DaVinciConfig) -> Void = {_ in }) -> DaVinci {
let config = DaVinciConfig()
config.module(CustomHeader.config) { customHeaderConfig in
customHeaderConfig.header(name: Request.Constants.xRequestedWith, value: Request.Constants.forgerockSdk)
customHeaderConfig.header(name: Request.Constants.xRequestedWith, value: Request.Constants.pingSdk)
customHeaderConfig.header(name: Request.Constants.xRequestedPlatform, value: Request.Constants.ios)
}
config.module(NodeTransformModule.config)
Expand Down
2 changes: 1 addition & 1 deletion Davinci/DavinciTests/DaVinciTests.swift
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ final class DaVinciTests: XCTestCase {
// XCTAssertEqual(formData["username"] as? String, "My First Name")
// XCTAssertEqual(formData["password"] as? String, "My Password")

XCTAssertEqual(request.allHTTPHeaderFields!["x-requested-with"], "forgerock-sdk")
XCTAssertEqual(request.allHTTPHeaderFields!["x-requested-with"], "ping-sdk")
XCTAssertEqual(request.allHTTPHeaderFields!["x-requested-platform"], "ios")
XCTAssertTrue(request.allHTTPHeaderFields!["Cookie"]?.contains("interactionId") ?? false)
//XCTAssertTrue(request.allHTTPHeaderFields!["Cookie"]?.contains("interactionToken") ?? false)
Expand Down
2 changes: 1 addition & 1 deletion Orchestrate/Orchestrate/Request.swift
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ public class Request {
public static let accept = "Accept"
public static let xRequestedWith = "x-requested-with"
public static let xRequestedPlatform = "x-requested-platform"
public static let forgerockSdk = "forgerock-sdk"
public static let pingSdk = "ping-sdk"
public static let ios = "ios"
public static let stCookie = "ST"
public static let stNoSsCookie = "ST-NO-SS"
Expand Down

0 comments on commit 2f42bc6

Please sign in to comment.