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

populate status for readystate 2 in more cases #98

Open
wants to merge 3 commits into
base: gh-pages
Choose a base branch
from

Conversation

euank
Copy link

@euank euank commented Nov 7, 2018

I've added a test, but unfortunately the test was passing before this change so it doesn't exhibit the true problem.

The issue I've run into is using xhook via xdomain with the aws-sdk.

Specifically, if I have the following code in the browser:

<script src="my-copy-of-xdomain-built-with-new-xhook/xdomain.js" debug="true" slave="https://s3.amazonaws.com/my-bucket/proxy.html"></script>
var creds = new AWS.Credentials({
  accessKeyId: 'akid',
  secretAccessKey: 'asecret',
});
AWS.config.update({region: 'us-east-1', credentials: creds, logger: console, s3ForcePathStyle: true});
var s3 = new AWS.S3();

s3.listBuckets().promise()
.then(data => console.log(data))
.catch(err => console.log(err));

Without this change, that code results in an error because the readyState == 3 change has not yet set 'status'.

With this change, the above code seems to work correctly.

I think that the main difference between the test environment and the AWS request is that the AWS request is chunked, so the headers really are sent before the body... I couldn't figure out a way to reproduce the error in the mocha test environment.

If you're interested, the aws-sdk code making the request which fails without this change is here.

euank added 3 commits November 6, 2018 22:39
On case-sensitive filesystems with modern versions of grunt-source, it
requires a lowercause 's' there.
@github-actions github-actions bot force-pushed the gh-pages branch 2 times, most recently from 0d383e5 to b68decc Compare August 19, 2022 14:11
@github-actions github-actions bot force-pushed the gh-pages branch 2 times, most recently from 6047ce7 to 07a4ac7 Compare August 28, 2023 02:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant