Skip to content

fix: use urlparse instead of regex for proxy determination#9254

Merged
mscolnick merged 2 commits intomainfrom
dm/ipv6-fail
Apr 20, 2026
Merged

fix: use urlparse instead of regex for proxy determination#9254
mscolnick merged 2 commits intomainfrom
dm/ipv6-fail

Conversation

@dmadisetti
Copy link
Copy Markdown
Collaborator

📝 Summary

closes #9250

Replaces brittle regex for proxy determination with urlparse

Copilot AI review requested due to automatic review settings April 17, 2026 22:17
@vercel
Copy link
Copy Markdown

vercel Bot commented Apr 17, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
marimo-docs Ready Ready Preview, Comment Apr 20, 2026 8:57pm

Request Review

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes startup crashes when --proxy is provided as a full URL by replacing a brittle proxy host/port regex with urllib.parse.urlparse, ensuring the external-facing host/port are derived correctly for URL generation and display.

Changes:

  • Replace regex-based proxy parsing with urlparse-based parsing in _resolve_proxy.
  • Add tests covering proxy resolution for bare hostnames, host:port, scheme URLs, and bracketed IPv6.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 3 comments.

File Description
marimo/_server/start.py Switch proxy host/port determination to urlparse and apply scheme-based default ports (80/443).
tests/_server/test_startup_url.py Add parametrized tests for _resolve_proxy with common proxy formats.

Comment thread marimo/_server/start.py
Comment thread tests/_server/test_startup_url.py
Comment thread tests/_server/test_startup_url.py
@dmadisetti dmadisetti added the bug Something isn't working label Apr 17, 2026
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
@dmadisetti dmadisetti requested a review from mscolnick April 20, 2026 20:28
@mscolnick mscolnick merged commit aba1814 into main Apr 20, 2026
29 of 43 checks passed
@mscolnick mscolnick deleted the dm/ipv6-fail branch April 20, 2026 21:06
@github-actions
Copy link
Copy Markdown

🚀 Development release published. You may be able to view the changes at https://marimo.app?v=0.23.2-dev69

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

--proxy with a full URL crashes marimo at startup: ValueError: Invalid IPv6 URL

3 participants