Skip to content

Commit

Permalink
lib: make sure portal's host is not empty
Browse files Browse the repository at this point in the history
  • Loading branch information
stavros-k committed Oct 17, 2024
1 parent 05eab60 commit a481e8f
Show file tree
Hide file tree
Showing 15 changed files with 7 additions and 5 deletions.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
9 changes: 5 additions & 4 deletions library/1.1.4/metadata.py → library/1.1.5/metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,9 @@ def get_portals(portals: list):
name = portal.get("name", "Web UI")
scheme = portal.get("scheme", "http")
path = portal.get("path", "/")
host = portal.get("host", "0.0.0.0")
if not host: # In case it is set to ""
host = "0.0.0.0"

if not name:
utils.throw_error("Expected [portal.name] to be set")
Expand All @@ -54,15 +57,13 @@ def get_portals(portals: list):
if not portal.get("port"):
utils.throw_error("Expected [portal.port] to be set")
if not path.startswith("/"):
utils.throw_error(
f"Expected [portal.path] to start with /, got [{portal['path']}]"
)
utils.throw_error(f"Expected [portal.path] to start with [/], got [{portal['path']}]")

result.append(
{
"name": name,
"scheme": scheme,
"host": portal.get("host", "0.0.0.0"),
"host": host,
"port": portal["port"],
"path": path,
}
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 2 additions & 1 deletion library/hashes.yaml
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
0.0.1: f074617a82a86d2a6cc78a4c8a4296fc9d168e456f12713e50c696557b302133
1.1.4: 6e32ff5969906d9c3a10fea2b17fdd3197afb052d3432344da03188d8a907113
1.1.5: ddd86a8541b457e46c684ffbea0c5dab549e139bf574efb0e9553e5e4f78bbe4
2.0.0: 903dd80c3d8e5aee64b09612ba149f55fc6a8ab041357340d6f981f1748c618f

0 comments on commit a481e8f

Please sign in to comment.