You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When the _xhrRequestConfig_responseHeaders of an XhrRequest gets configured as OnlyHeaders $ singleton "SomeHeader", the _xhrResponse_headers map of the resulting XhrResponse contains a value of "" for the SomeHeader header, even if the actual HTTP response doesn't contain any SomeHeader header.
I think this behavior is very surprising; It's unintuitive and it's inconsistent with configuring the XhrRequest as _xhrRequestConfig_responseHeaders = AllHeaders, which will (necessarily) return an XhrResponse with a _xhrResponse_headers map without a SomeHeader value.
I believe this fromMaybe "" is responsible for that behavior, and I don't understand what purpose it really serves by conflating the missing header vs. header with empty string cases:
When the
_xhrRequestConfig_responseHeaders
of anXhrRequest
gets configured asOnlyHeaders $ singleton "SomeHeader"
, the_xhrResponse_headers
map of the resultingXhrResponse
contains a value of""
for theSomeHeader
header, even if the actual HTTP response doesn't contain anySomeHeader
header.I think this behavior is very surprising; It's unintuitive and it's inconsistent with configuring the
XhrRequest
as_xhrRequestConfig_responseHeaders = AllHeaders
, which will (necessarily) return anXhrResponse
with a_xhrResponse_headers
map without aSomeHeader
value.I believe this
fromMaybe ""
is responsible for that behavior, and I don't understand what purpose it really serves by conflating the missing header vs. header with empty string cases:reflex-dom/reflex-dom-core/src/Reflex/Dom/Xhr/Foreign.hs
Line 87 in 2028ff6
The text was updated successfully, but these errors were encountered: