refactor: url validation (http/https) before opening #1615
Merged
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.
Summary:
I've been curious about how rn cli handle app in debug mode interactions with IDE,
I know that when you get some error in your app (e.g crash) when you are coding, you get an error message saying what line broke.. And that got me thinking.. how can the app open my IDE? and I came across this endpoint from cli package
cli-server-api:In first sight i assumed it was HTTP and HTTPS only, but its not, turns out you can open any uri scheme.
To put this in perspective, if you have the cli-server-api running and someone inside your network wants your pc to open any uri scheme, they can though this endpoint. Especial thanks to @R3tr074 for investigating it further (poc)
POC:
Other uri schemes:

I've tested on linux and macOs, linux depends on how you set up your
xdg-openconfig, and macOs uses the defaultopencommand;You can see what uri schemes are available on MacOs using this command
Test Plan:
I tested it with react-native change locally, and linking with my projects as previously recommended in contributing guide
Result:
