Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Host parsing when circuits.web.Server is bound to a UNIX Socket (#…
…165)
- Loading branch information
Showing
7 changed files
with
92 additions
and
49 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -213,7 +213,8 @@ def abspath(self): | |
|
||
def lower(self): | ||
'''Lowercase the hostname''' | ||
self._host = self._host.lower() | ||
if self._host is not None: | ||
self._host = self._host.lower() | ||
This comment has been minimized.
Sorry, something went wrong.
spaceone
Contributor
|
||
return self | ||
|
||
def sanitize(self): | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,8 +4,10 @@ | |
""" | ||
|
||
import re | ||
import os | ||
import zlib | ||
import time | ||
import stat | ||
import struct | ||
from math import sqrt | ||
from io import TextIOWrapper | ||
|
@@ -29,6 +31,15 @@ | |
image_map_pattern = re.compile("^[0-9]+,[0-9]+$") | ||
|
||
|
||
def is_unix_socket(path): | ||
if not os.path.exists(path): | ||
This comment has been minimized.
Sorry, something went wrong.
spaceone
Contributor
|
||
return False | ||
|
||
mode = os.stat(path).st_mode | ||
|
||
return stat.S_ISSOCK(mode) | ||
|
||
|
||
def average(xs): | ||
return sum(xs) * 1.0 / len(xs) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,6 +10,7 @@ wheel | |
# Running Tests | ||
tox | ||
pytest | ||
uhttplib | ||
coveralls | ||
pytest-cov | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This is a regression. One cannot access server.base anymore before starting the component tree.