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

Use FQDN only for DNS and drop trailing dot for other operations #1255

Merged

Conversation

haikuginger
Copy link
Contributor

Fixes #1254.

@haikuginger
Copy link
Contributor Author

Looks like the new version of Tox doesn't like our config file. Looking into it; easy fix would be to pin to 2.7.0 for now.

@Lukasa
Copy link
Sponsor Contributor

Lukasa commented Sep 2, 2017

Cool, let's see how this goes.

@codecov-io
Copy link

codecov-io commented Sep 2, 2017

Codecov Report

Merging #1255 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff           @@
##           master   #1255   +/-   ##
======================================
  Coverage     100%    100%           
======================================
  Files          21      21           
  Lines        1985    1989    +4     
======================================
+ Hits         1985    1989    +4
Impacted Files Coverage Δ
urllib3/connection.py 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 945f2a6...68f3475. Read the comment docs.

Copy link
Sponsor Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

Cool, generally looks good! Some thoughts inline.

appveyor.yml Outdated
@@ -57,7 +57,7 @@ install:
# Upgrade to the latest version of pip to avoid it displaying warnings
# about it being out of date.
- pip install --disable-pip-version-check --user --upgrade pip wheel
- pip install tox virtualenv
- pip install tox==2.1.1 virtualenv
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

It would be nice if we could work out why tox is mad at us so we can remove these pins. Any idea?

(key, value) = header.split(b': ')
if key.decode('ascii').startswith(u'Host'):
received_host.append(value.decode('ascii'))

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Might be nice to pull this header parsing logic out into a separate helper function. It's the kind of thing that might come up from time to time.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense! Something like this?

def assert_header_received(self, received_headers, header_name, expected_value=None):
    """
    Asserts that a header with the given name was received; if a value is passed to
    `expected_value`, asserts that the header has that value. 
    """
    pass

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Yeah, sounds good to me!

Setter for the `host` property.
"""
self._dns_host = value

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Hrm, we might want to put a note here that points out that this assumes that only urllib3 code ever sets this property.

More generally, I wonder if we should just remove the setter and change the __init__ to do the right thing. What are your thoughts on that?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Makes sense to me.

I would tend towards not changing __init__; due to the way it's structured in httplib, we'd essentially have to copy out a chunk of stdlib code (not a huge chunk, sure, but a chunk) and make one small tweak; this is a relatively small change in comparison.

Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

Fair enough. 😄

@sigmavirus24
Copy link
Contributor

Tox looks to be broken on parsing setenv settings in tox.ini my suspicion would be in trying to parse https://github.com/shazow/urllib3/blob/5206734fda1f2365afc49a070efa46c9ba68372e/tox.ini#L38 since it's expecting that it can split on an =.

@Lukasa
Copy link
Sponsor Contributor

Lukasa commented Sep 3, 2017

Did that stop being valid syntax?

@sigmavirus24
Copy link
Contributor

I don't think so, I suspect it's a regression. They've had other regressions in the past involving references to other sections like this

@haikuginger
Copy link
Contributor Author

Looks like this is fixed now, so I'll remove the pins and check again.

@haikuginger
Copy link
Contributor Author

Okay, I think the single Appveyor fail is spurious, but I don't see a way to restart the build without pushing another commit, so that can wait until @Lukasa okays the test method I suggested. The GAE failure on Travis is pretty consistent though; @jonparrott, any thoughts on that as the resident GAE expert?

@haikuginger
Copy link
Contributor Author

Rebased and squashed from 62b9e1c.

@haikuginger
Copy link
Contributor Author

@Lukasa, it looks like Travis is currently experiencing issues with their macOS builds; if you want to give a runthrough and a final 👍, I can merge once those builds complete.

@haikuginger
Copy link
Contributor Author

Rebased from 88bcf98.

@haikuginger
Copy link
Contributor Author

Gentle ping to @Lukasa; please ignore if you're taking a break from OSS.

@sigmavirus24, can you provide a review in case @Lukasa is unavailable?

Copy link
Sponsor Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

One tiny note and then we're good to go.

received_headers,
header_name,
expected_value=None
):
Copy link
Sponsor Contributor

Choose a reason for hiding this comment

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

I'm not wild about this indentation. 😉 Mind matching it up with the rest of the project?

Copy link
Contributor Author

@haikuginger haikuginger Sep 15, 2017

Choose a reason for hiding this comment

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

Sure! Another project I'm involved with had linting set up to whine if the parameters line up with the first line of the function, and that's why I did it here, but I agree it looks skeevy.

@haikuginger haikuginger force-pushed the haikuginger/fqdn-certificate branch 2 times, most recently from 12d98c4 to 36bf9cc Compare October 13, 2017 13:16
@haikuginger
Copy link
Contributor Author

@Lukasa, finally addressed that note.

@Lukasa
Copy link
Sponsor Contributor

Lukasa commented Oct 14, 2017

Looks like we need to add some pins to some of our dependencies for 2.6.

@haikuginger
Copy link
Contributor Author

Rebased from 36bf9cc to pick up test changes.

@haikuginger
Copy link
Contributor Author

@Lukasa, can you do a final run-through on this? I believe it should be set to merge once we have a green light from Travis (test issues were resolved elsewhere).

Copy link
Sponsor Contributor

@Lukasa Lukasa left a comment

Choose a reason for hiding this comment

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

LGTM, ship it

@haikuginger haikuginger merged commit da05fe2 into urllib3:master Dec 15, 2017
@haikuginger haikuginger deleted the haikuginger/fqdn-certificate branch December 15, 2017 13:18
Dobatymo pushed a commit to Dobatymo/urllib3 that referenced this pull request Mar 16, 2022
…tificate

Use FQDN only for DNS and drop trailing dot for other operations
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.

None yet

4 participants