Skip to content

Commit

Permalink
pushed workaround for iOS(<=12.4) webkit issue
Browse files Browse the repository at this point in the history
Signed-off-by: Thejas Nanjunda <thejasn.416@gmail.com>
  • Loading branch information
thejasn committed Oct 12, 2021
1 parent 2cc253e commit ceddf89
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions lib/src/client/transport/xhr_transport.dart
Original file line number Diff line number Diff line change
Expand Up @@ -130,13 +130,17 @@ class XhrTransportStream implements GrpcTransportStream {
StackTrace.current);
return;
}
if (!_checkContentType(contentType)) {
_onError(
GrpcError.unavailable('XhrConnection bad Content-Type $contentType',
null, _request.responseText),
StackTrace.current);
return;
}

// TODO: This is added as a workaround for CORS preflight issue in <=iOS12.4.
// This invalidates CORS policy between iOS webkit and envoyproxy.
//
// if (!_checkContentType(contentType)) {
// _onError(
// GrpcError.unavailable('XhrConnection bad Content-Type $contentType',
// null, _request.responseText),
// StackTrace.current);
// return;
// }
if (_request.response == null) {
_onError(
GrpcError.unavailable('XhrConnection request null response', null,
Expand Down

0 comments on commit ceddf89

Please sign in to comment.