fix: Use explicit import path for request-filtering-agent asar compat…#721
Open
rafarhat wants to merge 3 commits intoAzure:mainfrom
Open
fix: Use explicit import path for request-filtering-agent asar compat…#721rafarhat wants to merge 3 commits intoAzure:mainfrom
rafarhat wants to merge 3 commits intoAzure:mainfrom
Conversation
On Linux, dynamic import() of ESM modules from inside .asar archives fails with ENOTDIR because the ESM loader bypasses Electron's patched fs module. Fix by: - Adding asarUnpack for request-filtering-agent and ipaddr.js so they are extracted as real files alongside the asar archive - Redirecting the fallback import path from .asar/ to .asar.unpacked/ on Linux where the ESM loader cannot resolve asar-internal paths
…ility Replace ESM-only request-filtering-agent with CJS-compatible ssrf-req-filter to eliminate complex dynamic import workarounds in the Electron main process. - Remove 37-line dynamic import fallback chain (Function constructor hack, asar unpacking, silent degradation) - Replace with simple static import and direct ssrf-req-filter(url) call - Remove request-filtering-agent from asarUnpack (CJS works inside asar) - Remove request-filtering-agent from Jest transformIgnorePatterns - Same SSRF protection: DNS lookup + IP validation via ipaddr.js
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Use explicit import path for request-filtering-agent asar compatbility
Update Package Version to 0.15.14
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Thank you for contributing to the Azure IoT Explorer!
This checklist is used to make sure that common guidelines for a pull request are followed.
General Guidelines
npm run testcommand)