Skip to content

Commit

Permalink
use both json and forms
Browse files Browse the repository at this point in the history
  • Loading branch information
theSage21 committed Feb 12, 2019
1 parent e10c65e commit 80f426b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
7 changes: 5 additions & 2 deletions bottle_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
import bottle
import inspect
import logging
from collections import defaultdict
from functools import wraps, partial

__version__ = "2019.2.4"
__version__ = "2019.2.12"


def __cors_dict__(allow_credentials, origin, methods):
Expand Down Expand Up @@ -137,7 +138,9 @@ def new_fn(*a, **kw):
elif method == "GET" or method == "HEAD":
given = bottle.request.query
else: # Everyone else uses forms
given = bottle.request.forms
given = bottle.request.json
given = dict() if given is None else dict(given)
given = {**given, **dict(bottle.request.forms)}
if given is None:
return bottle.abort(
400,
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
project = "bottle-tools"
copyright = "2019, Arjoonn Sharma"
author = "Arjoonn Sharma"
version = "2019.2.4"
version = "2019.2.12"

# The short X.Y version
version = version
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from setuptools import setup

__version__ = "2019.2.4"
__version__ = "2019.2.12"

with open("README.md", "r") as fl:
long_desc = fl.read()
Expand Down

0 comments on commit 80f426b

Please sign in to comment.