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

fix(lottie.ts): passing credentials include param to fetch request #131

Closed
wants to merge 8 commits into from

Conversation

akil3
Copy link
Contributor

@akil3 akil3 commented Jun 2, 2023

Fetch request is failing with 403 when trying to fetch lottie json hosted on another domain that gates the assests behind credentials. https://javascript.info/fetch-crossorigin#credentials

Copy link
Contributor

@mrloop mrloop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the PR. I don't think this should be the default, but configurable. How about a named argument @fetchOptions so the call await fetch(this.args.path, this.args.fetchOptions) can be made? Would need a test, maybe sinon can be used, its already a dependency for the tests, to mock fetch and check options are passed correctly?

@akil3 akil3 force-pushed the update-fetch-to-include-credentials branch from e4fa109 to c4c0627 Compare June 5, 2023 16:17
…request

Fetch request is failing with 403 when trying to fetch lottie json hosted on another domain that gates the assests behind credentials.
https://javascript.info/fetch-crossorigin#credentials
@akil3 akil3 force-pushed the update-fetch-to-include-credentials branch from c4c0627 to f9cc6be Compare June 5, 2023 16:51
Also removed ember-window-mock since its really not needed and all tests pass w/out it
@akil3
Copy link
Contributor Author

akil3 commented Jun 5, 2023

@mrloop added fetchOptions argument as suggested and couple test cases for the same.

Copy link
Contributor

@mrloop mrloop left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update, left a couple of comments about removing ember-window-mock

@mrloop mrloop added the enhancement New feature or request label Jun 15, 2023
pnpm-lock.yaml Outdated
@@ -1,4 +1,8 @@
lockfileVersion: '6.0'
lockfileVersion: '6.1'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like your using pnpm v8.6.1, there was breaking change with this release which was fixed in v8.6.2. See pnpm/pnpm#6648. If you upgrade pnpm and then upgrade ember-window-mock again then the lock file wont change it's lock file version. We want to remain on '6.0'. Everything else looks good

Copy link
Contributor Author

@akil3 akil3 Jun 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Upgraded pnpm to v8.6.2 and updated the package.
The version is back to 6.0 but its still adding these properties for me though.

settings: autoInstallPeers: true excludeLinksFromLockfile: false

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, I'd remove those settings. Also the build is failing for unrelated issues, it should pass if you rebase on main, I spent a bit of time yesterday merging outstanding PRs which fixed the failing build. Ideally this PR would be in two commits the first commit with the dependency update and the second with the feature update. Alternatively one commit would be fine, with all of them squashed. This means we'll have a clean history, and one which all commit should build and pass test suite, helpful if you ever need to git bisect the repo.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Quick update, do want merge this PR, but ember-window-mock is a breaking change due to it dropping support for ember 4.4. So in another PR me or another maintainer will drop 4.4 and other unsupported ember versions. 4.4 last security updates are in a months time. The PR is also failing on other ember version but think its a CI issue, so I need to fix the build pipeline. Not sure of the timeline

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the update @mrloop

@nicolasgasco
Copy link
Contributor

Hi, @akil3! Thank you for your interest in ember-lottie. What's the outcome of your discussion with @mrloop ? Do you still mean to work on this PR or would you rather close it for now?

@mrloop
Copy link
Contributor

mrloop commented Nov 10, 2023

I've rebased and cleaned up in #274, closing this MR in favour of that one

@mrloop mrloop closed this Nov 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants