Skip to content
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

Rework IPv6 support #837

Merged
merged 7 commits into from
Nov 8, 2020
Merged

Rework IPv6 support #837

merged 7 commits into from
Nov 8, 2020

Conversation

florimondmanca
Copy link
Member

@florimondmanca florimondmanca commented Oct 24, 2020

Prompted by #836 (comment)

It looks like IPv6 support as added (or most likely fixed? I found #383 dating back from June 2019) into 0.12.2 to resolve #553. This was done via #803, which glossed over a small edge case leading to host="localhost" not working anymore, leading to issue #825, and then a fix via #827.

But @euri10 mentioned in #827 that the fix wasn't the prettiest, so I went ahead and started this whole thing all over — here's what I did in this PR…

  1. Revert Fix server not running with explicit hostname #827
  2. Revert Fix reload with ipv6 host #803
  3. Re-implement them in a simpler way. Also expanded the test_run() test so that it tests all three cases: default case (127.0.0.1), DNS hostname (localhost), and IPv6 ([::]).
  4. Update docs to mention that --host now supports IPv6 addresses, with an example.

It might be easy to review commit-by-commit, since the overall diff conflates reverts and the actual re-implementation. :-)

Note: for the changelog, we'll probably want to not mention #827, and mention this PR instead (if we decide to merge it).

Copy link
Member

@euri10 euri10 left a comment

Choose a reason for hiding this comment

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

Looks good to me @florimondmanca , I just left minor comments

tests/test_main.py Outdated Show resolved Hide resolved
uvicorn/config.py Outdated Show resolved Hide resolved
Co-authored-by: euri10 <euri10@users.noreply.github.com>
uvicorn/config.py Outdated Show resolved Hide resolved
uvicorn/config.py Outdated Show resolved Hide resolved
uvicorn/config.py Outdated Show resolved Hide resolved
uvicorn/config.py Outdated Show resolved Hide resolved
uvicorn/main.py Outdated Show resolved Hide resolved
uvicorn/main.py Outdated Show resolved Hide resolved
uvicorn/main.py Outdated Show resolved Hide resolved
uvicorn/main.py Outdated Show resolved Hide resolved
@florimondmanca
Copy link
Member Author

@euri10 Thanks for your comment on #837 (comment) — good point, just updated the PR to remove un,ecessary changes.

@euri10
Copy link
Member

euri10 commented Oct 26, 2020 via email

@euri10
Copy link
Member

euri10 commented Oct 26, 2020

nah actually @florimondmanca I think you went too far in diff reduction, you need to revert last commit 01ffc58 because it's on the Server object and not on the Conifg one

Copy link
Member

@euri10 euri10 left a comment

Choose a reason for hiding this comment

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

last commit breaks CI

@florimondmanca
Copy link
Member Author

@euri10 Yup, thanks — should be fixed now, CI should pass but let's see. :-)

Copy link
Member

@euri10 euri10 left a comment

Choose a reason for hiding this comment

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

Lgtm 😎

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

reload option works only with IPv4 host
3 participants