About downloading a remote config #2167
Closed
lewis-yeung
started this conversation in
Ideas
Replies: 1 comment 7 replies
-
Idea 1 is not an option as that's a potential security issue. I deliberately only allow https. Everything else is good as that was also still on my list as I noticed it somewhere last week during another fix. |
Beta Was this translation helpful? Give feedback.
7 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm testing logic about how OMP uses a remote config and I gets two ideas on it. Ready to create a new PR.
💡
Idea 1: Support both HTTPS & HTTP URLsA remote config URL may be an HTTP one, e.g., from a private site instead ofraw.githubusercontent.com
only.💡 Idea 2: Do not resolve the URL when a download fails
When I test
oh-my-posh init pwsh
in a bare PowerShell (launched with-NoProfile
option) on Windows and without an Internet connection, it shows:That means when the download of a remote config fails, the URL will be mistakenly resolved to an absolute path by joining with the CWD.
oh-my-posh/src/environment/shell.go
Lines 236 to 240 in 623fabc
oh-my-posh/src/environment/shell.go
Lines 251 to 255 in 623fabc
In most cases it will not cause a problem since the fake path will not actually flow into
$env:POSH_THEME
in PowerShell. However, when I testoh-my-posh init zsh
in zsh on WSL, it shows:The env
POSH_THEME
represents an invalid path in this case.I think we can make the check like this:
where an early return is reasonable since a default config will definitely be used in this case.
Beta Was this translation helpful? Give feedback.
All reactions