Skip to content

Commit

Permalink
Merge pull request #791 from hugapi/feature/fix-issue-790
Browse files Browse the repository at this point in the history
Restore pre-Falcon2 defaults
  • Loading branch information
timothycrosley committed May 11, 2019
2 parents 1f6491b + 7aeef11 commit 676fd02
Show file tree
Hide file tree
Showing 6 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 2.5.1
current_version = 2.5.2

[bumpversion:file:.env]

Expand Down
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ fi

export PROJECT_NAME=$OPEN_PROJECT_NAME
export PROJECT_DIR="$PWD"
export PROJECT_VERSION="2.5.1"
export PROJECT_VERSION="2.5.2"

if [ ! -d "venv" ]; then
if ! hash pyvenv 2>/dev/null; then
Expand Down
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,11 @@ pip3 install hug --upgrade

Ideally, within a virtual environment.


Changelog
=========
### 2.5.2 hotfix - May 10, 2019
- Fixed issue #790 - Set Falcon defaults to pre 2.0.0 version to avoid breaking changes for Hug users until a Hug 3.0.0 release. The new default Falcon behaviour can be defaulted before hand by setting `__hug__.future = True`.

### 2.5.1 hotfix - May 9, 2019
- Fixed issue #784 - POST requests broken on 2.5.0
- Optimizations and simplification of async support, taking advantadge of Python3.4 deprecation.
Expand Down
2 changes: 1 addition & 1 deletion hug/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,4 +21,4 @@
"""
from __future__ import absolute_import

current = "2.5.1"
current = "2.5.2"
10 changes: 8 additions & 2 deletions hug/api.py
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,11 @@ def version_router(
def server(self, default_not_found=True, base_url=None):
"""Returns a WSGI compatible API server for the given Hug API module"""
falcon_api = self.falcon = falcon.API(middleware=self.middleware)
falcon_api.req_options.keep_blank_qs_values = False
if not self.api.future:
falcon_api.req_options.keep_blank_qs_values = False
falcon_api.req_options.auto_parse_qs_csv = True
falcon_api.req_options.strip_url_path_trailing_slash = True

default_not_found = self.documentation_404() if default_not_found is True else None
base_url = self.base_url if base_url is None else base_url

Expand Down Expand Up @@ -510,10 +514,11 @@ class API(object, metaclass=ModuleSingleton):
"started",
"name",
"doc",
"future",
"cli_error_exit_codes",
)

def __init__(self, module=None, name="", doc="", cli_error_exit_codes=False):
def __init__(self, module=None, name="", doc="", cli_error_exit_codes=False, future=False):
self.module = module
if module:
self.name = name or module.__name__ or ""
Expand All @@ -523,6 +528,7 @@ def __init__(self, module=None, name="", doc="", cli_error_exit_codes=False):
self.doc = doc
self.started = False
self.cli_error_exit_codes = cli_error_exit_codes
self.future = future

def directives(self):
"""Returns all directives applicable to this Hug API"""
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ def list_modules(dirname):

setup(
name="hug",
version="2.5.1",
version="2.5.2",
description="A Python framework that makes developing APIs "
"as simple as possible, but no simpler.",
long_description=long_description,
Expand Down

0 comments on commit 676fd02

Please sign in to comment.