Skip to content

fix: proper relative url parsing #380

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 18, 2025
Merged

fix: proper relative url parsing #380

merged 1 commit into from
May 18, 2025

Conversation

cristipufu
Copy link
Member

The previous implementation would not take query string params into consideration:

def _is_relative_url(self, url: str) -> bool:
        parsed = urlparse(url)
        print(f"url: {url}")
        print(f"parsed: {parsed}")
        return parsed.hostname is None and parsed.path == url
[2025-05-18 09:00:59,576][INFO] url: mcp/mcp/gmaps-hosted/runtime/abort?runtimeId=c370591f-a68e-4103-9e4b-d02341fa6a35
[2025-05-18 09:00:59,576][INFO] parsed: ParseResult(scheme='', netloc='', path='mcp_/mcp/gmaps-hosted/runtime/abort', params='', query='runtimeId=c370591f-a68e-4103-9e4b-d02341fa6a35', fragment='')
[2025-05-18 09:00:59,576][INFO] self._is_relative_url(url): self._is_relative_url(url)=False

@cristipufu cristipufu self-assigned this May 18, 2025
@cristipufu cristipufu merged commit 5e8183a into main May 18, 2025
7 checks passed
@cristipufu cristipufu deleted the fix/relative_url branch May 18, 2025 16:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant