Skip to content

Commit

Permalink
andfanilo#133 handle leading and trailing slashes in the specified `s…
Browse files Browse the repository at this point in the history
…erver.baseUrlPath`
  • Loading branch information
drnguyenn committed Jul 16, 2023
1 parent e9c74ad commit f606417
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion streamlit_drawable_canvas/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,11 @@ def st_canvas(
background_image_url = st_image.image_to_url(
background_image, width, True, "RGB", "PNG", f"drawable-canvas-bg-{md5(background_image.tobytes()).hexdigest()}-{key}"
)
background_image_url = st._config.get_option("server.baseUrlPath") + background_image_url
base_url_path: str = st._config.get_option("server.baseUrlPath").strip("/")
if base_url_path:
base_url_path = "/" + base_url_path
background_image_url = base_url_path + background_image_url

background_color = ""

# Clean initial drawing, override its background color
Expand Down

0 comments on commit f606417

Please sign in to comment.