Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Use urllib to parse the URL for the host and port#55

Open
DarioBianco wants to merge 1 commit intomicropython:masterfrom
DarioBianco:patch-1
Open

Use urllib to parse the URL for the host and port#55
DarioBianco wants to merge 1 commit intomicropython:masterfrom
DarioBianco:patch-1

Conversation

@DarioBianco
Copy link

Parse the received URL string with urllib.parse.urlparse() to extract the hostname and port number (instead of splitting the URL to extract the hostname and port).

parse_remote() previously split the host string with ":" to get the host and port number, but splitting may result in a list of 3 strings (e.g., 'ws://192.168.4.1:8266' would become ['ws', '//192.168.4.1', '8266']. The code would crash because of the double forward slashes at the beginning of the host string.

Parse the received URL string with urllib.parse.urlparse() to extract the hostname and port number (instead of splitting the URL to extract the hostname and port).parse_remote() previously split the host string with ":" to get the host and port number, but splitting may result in a list of 3 strings (e.g., 'ws://192.168.4.1:8266'  would become ['ws', '//192.168.4.1', '8266']. The code would crash because of the double forward slashes at the beginning of the host string.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

No reviews

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

1 participant

@DarioBianco

[8]ページ先頭

©2009-2026 Movatter.jp