Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added support for IE's handling of 204 status codes where it returns 1223 instead of 204. #9

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 13 additions & 2 deletions WLRemoteLink.j
Original file line number Diff line number Diff line change
Expand Up @@ -636,6 +636,17 @@ var WLRemoteActionSerial = 1;
return NO;
}

- (void)setStatusCode:(int)anInt
{
[self willChangeValueForKey:@"statusCode"];

// IE 8 and 9 can not handle HTTP responses with status code 204 (No Content) properly.
// Code 1223 will be used instead. If this happens, we can safely map it to 204.
statusCode = (anInt == 1223) ? 204 : anInt;

[self didChangeValueForKey:@"statusCode"];
}

/*!
Reset the action so that it can be retried. This message is sent after an action fails due to
a network or a server error and will need to be performed a second time.
Expand Down Expand Up @@ -738,8 +749,8 @@ var WLRemoteActionSerial = 1;
{
var code = [aResponse statusCode];
[self setStatusCode:code];
if (code < 200 || code > 299)
CPLog.error("Received error code %d.", code);
if (statusCode < 200 || statusCode > 299)
CPLog.error("Received error code %d.", statusCode);
}
}

Expand Down