allow string as post body data type

This commit is contained in:
DawudOsman 2025-05-05 17:07:48 +01:00
parent 791b033efc
commit 4b4f76392d
2 changed files with 2 additions and 2 deletions

View file

@ -162,7 +162,7 @@ extension JSContext {
if(method != "GET")
{
// Ensure body is properly serialized
processedBody = body ? JSON.stringify(body) : null
processedBody = (body && (typeof body === 'object')) ? JSON.stringify(body) : (body || null)
}
return new Promise(function(resolve, reject) {

View file

@ -738,7 +738,7 @@ struct MediaInfoView: View {
if let currTitle = streams[index]["title"] as? String
{
title = currTitle
streamUrl = (streams[index]["streamUrl"] as? String)!
streamUrl = (streams[index]["streamUrl"] as? String) ?? ""
}
else
{