feat: implement XMLHttpRequest.withCredentials#721
Conversation
|
Thank you! |
|
Could you tame the linter please? |
Sorry for that, now I have run the linter for C and JS |
Maybe there is some difference of clang-format between Homebrew version and Linux version, I have re-formatted it manually, according the output log of workflow |
|
The test failures seem related. |
It seems some limitations of GitHub Action are preventing cURL from saving cookies to I can't figure out why this is happening, so I make https://github.com/KawaiiZapic/txiki.js/blob/4a11f0e5be186b2fca6a9e09ae28959357370a56/tests/test-xhr-credentials.js#L40-L48 |
|
Perhaps use spawn to run the test in a nested environment? Or use |
I've fixed them in the latest commit and test in my fork repo, please approve this workflow run to test it works or not |
…y code in xhr-credentials test
src/js/polyfills/xhr.js
Outdated
| const path = globalThis[Symbol.for('tjs.internal.modules.path')]; | ||
| const TJS_HOME = tjs.env.TJS_HOME ?? path.join(tjs.homeDir, '.tjs'); | ||
|
|
||
| mkdirSync(TJS_HOME, { recursive: true }); |
There was a problem hiding this comment.
Can you perhaps add a flag so we only do this initialization once?
There was a problem hiding this comment.
I think is a good idea to handle the creation of TJS_HOME in a global initialize process, that will reduce duplicate code in storage and XHR, but I don't think this should be done in this PR.
There was a problem hiding this comment.
Agreed, let's do that afterwards 👍
|
Cheers! |
Implemented XHR.withCredentials with cURL's cookies jar
Also fixed #720