If the headers contain certain special characters (€, “, ≠, ∑, †, Ω etc..), calling the setHeaders method will throw an "Value is not a valid ByteString" error which unfortunately is neither propagated to the caller of the http-plugin, nor is the xhr request cancelled in this case.
By wrapping the setHeader-call into a try/catch, and fail the xhr request in case of an error, we'd make sure the caller of the http-plugin will receive a proper error and the xhr request gets canceled.
If the headers contain certain special characters (€, “, ≠, ∑, †, Ω etc..), calling the
setHeaders
method will throw an "Value is not a valid ByteString" error which unfortunately is neither propagated to the caller of the http-plugin, nor is the xhr request cancelled in this case.By wrapping the
setHeader
-call into a try/catch, and fail the xhr request in case of an error, we'd make sure the caller of the http-plugin will receive a proper error and the xhr request gets canceled.