Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix wrongly sent webcompat data
Browse files Browse the repository at this point in the history
  • Loading branch information
cuba committed Sep 21, 2023
1 parent 7bd5a44 commit bf441eb
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Sources/BraveShields/WebcompatReporter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public class WebcompatReporter {
case apiKey = "api_key"

case fpBlockSetting
case adBlockSettings
case adBlockSetting
case adBlockLists
case shieldsEnabled
case languages
Expand Down Expand Up @@ -111,7 +111,7 @@ public class WebcompatReporter {
try container.encode(report.isVPNEnabled, forKey: .braveVPNEnabled)
try container.encode(report.adBlockListTitles.joined(separator: ","), forKey: .adBlockLists)
try container.encode(report.fingerprintProtectionLevel.reportLabel, forKey: .fpBlockSetting)
try container.encode(report.adBlockLevel.reportLabel, forKey: .adBlockSettings)
try container.encode(report.adBlockLevel.reportLabel, forKey: .adBlockSetting)
try container.encode(apiKey, forKey: .apiKey)
}
}
Expand Down Expand Up @@ -161,6 +161,7 @@ public class WebcompatReporter {
let encoder = JSONEncoder()
var request = URLRequest(url: endpoint)
request.httpMethod = "POST"
request.addValue("application/json", forHTTPHeaderField: "Content-Type")
request.httpBody = try encoder.encode(payload)

if let userAgent = userAgent {
Expand Down

0 comments on commit bf441eb

Please sign in to comment.