Skip to content

Commit

Permalink
comments
Browse files Browse the repository at this point in the history
  • Loading branch information
daytime-em committed Apr 25, 2024
1 parent 712334d commit 51019cd
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion Sources/MuxPlayerSwift/Fairplay/FairplaySessionManager.swift
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,16 @@ class FairplaySessionManager {

var request = URLRequest(url: licenseURL(playbackId: playbackID, drmToken: drmToken, licenseDomain: licenseDomain))

// NOTE: The format of this POST body is likely to change before release. Instead of accepting
// this form-encoded body, a subsequent change will required only the HTTP body
// BODY PARAMS
// Base-64 the SPC, urlencode that, prepare form-encoded body with spc
let encodedSpcMessage = urlEncodeBase64(spcData.base64EncodedString())
print("SPC base64:", encodedSpcMessage)
var postData = String(format: "spc=%@", encodedSpcMessage)

Check warning on line 76 in Sources/MuxPlayerSwift/Fairplay/FairplaySessionManager.swift

View workflow job for this annotation

GitHub Actions / Run Unit Tests

variable 'postData' was never mutated; consider changing to 'let' constant

// DRMToday example appends `offline` to POST body, but we are not doing offline keys yet
// also, we don't like the form-encoded POST body

// QUERY PARAMS
request.setValue("application/x-www-form-urlencoded", forHTTPHeaderField: "Content-Type")
request.setValue(String(format: "%lu", request.httpBody?.count ?? 0), forHTTPHeaderField: "Content-Length")
Expand Down

0 comments on commit 51019cd

Please sign in to comment.