Skip to content

Commit

Permalink
fix: ui path validation
Browse files Browse the repository at this point in the history
Fix validation of the UI application path by removing it.

Signed-off-by: Moritz Röhrich <[email protected]>
  • Loading branch information
m-ildefons committed Nov 23, 2023
1 parent 4b0181e commit 578f798
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 8 deletions.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
# limitations under the License.

.PHONY: check-ui-backend-env
.DEFAULT_GOAL:=image-build-ui

########################################################################
# Testing cluster
Expand Down Expand Up @@ -103,5 +104,3 @@ check-ui-backend-env:
ifndef S3GW_SERVICE_URL
$(error S3GW_SERVICE_URL must be set.)
endif


6 changes: 0 additions & 6 deletions src/backend/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ def get_ui_path() -> str:
def post_process(key: str, value: str | None) -> str:
if value is None or value == "/":
return "/"
match = re.fullmatch(r"/?[\w./-]+(?:[\w]+)/?", value)
if match is None:
logger.error(
f"The value of the environment variable {key} is malformed: {value}" # noqa: E501
)
raise EnvironMalformedError(key)
return value if value.startswith("/") else f"/{value}"

path = get_environ_str("S3GW_UI_PATH", cb=post_process)
Expand Down

0 comments on commit 578f798

Please sign in to comment.