-
-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rev4188, Allow only white listed values for open_browser
- Loading branch information
1 parent
c7822ed
commit 155d8d4
Showing
2 changed files
with
7 additions
and
2 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1137,9 +1137,14 @@ def actionServerShowdirectory(self, to, directory="backup", inner_path=""): | |
def actionConfigSet(self, to, key, value): | ||
import main | ||
if key not in config.keys_api_change_allowed: | ||
self.response(to, {"error": "Forbidden you cannot set this config key"}) | ||
self.response(to, {"error": "Forbidden: You cannot set this config key"}) | ||
return | ||
|
||
if key == "open_browser": | ||
if value not in ["default_browser", "False"]: | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
HelloZeroNet
Owner
|
||
self.response(to, {"error": "Forbidden: Invalid value"}) | ||
return | ||
|
||
# Remove empty lines from lists | ||
if type(value) is list: | ||
value = [line for line in value if line] | ||
|
Sounds like a bad idea to me. I think there should be something like a
<select>
in UiConfig that lets you choose what browser to launch. We could have presets (Firefox, Chrome or Edge, sigh) and let the user choose the browser manually.