Skip to content

Commit

Permalink
Properly encode broken site reports (#821)
Browse files Browse the repository at this point in the history
  • Loading branch information
jaceklyp committed May 15, 2024
1 parent c1ce2cb commit 0cec790
Showing 1 changed file with 2 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public struct BrokenSiteReport {
case navigation
}

public static let allowedQueryReservedCharacters = CharacterSet(charactersIn: ",")
public static let allowedQueryReservedCharacters = CharacterSet.urlQueryParameterAllowed

let siteUrl: URL
let category: String
Expand Down Expand Up @@ -270,8 +270,7 @@ public struct BrokenSiteReport {
return "\(error.code) - \(error.domain):\(error.localizedDescription)"
}
let jsonString = try? String(data: JSONSerialization.data(withJSONObject: errorDescriptions), encoding: .utf8)!
let encodedString = jsonString?.addingPercentEncoding(withAllowedCharacters: .urlQueryParameterAllowed)
return encodedString ?? ""
return jsonString ?? ""
}

}

0 comments on commit 0cec790

Please sign in to comment.