8000 Release v3.0 by jacebrowning · Pull Request #135 · flask-api/flask-api · GitHub
[go: up one dir, main page]

Skip to content

Release v3.0 #135

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

Merged
merged 11 commits into from
Jun 15, 2021
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Allow request method to be set
  • Loading branch information
jacebrowning committed Jun 2, 2021
commit 766a2448bc9ab10d7736c6f9abfd3f559655aa82
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ endif
.PHONY: test
test: install ## Run unit and integration tests
$(NOSE) $(PACKAGE) $(NOSE_OPTIONS)
$(COVERAGESPACE) $(REPOSITORY) overall
$(COVERAGESPACE) update overall

.PHONY: read-coverage
read-coverage:
Expand Down
2 changes: 1 addition & 1 deletion docs/about/release-notes.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Release Notes

## Version 3.0
## Version 3.0 (beta)

* Dropped support for Flask `<2.0`.

Expand Down
2 changes: 1 addition & 1 deletion flask_api/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
from flask_api.app import FlaskAPI

__version__ = '3.0'
__version__ = '3.0b2'
9 changes: 8 additions & 1 deletion flask_api/request.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,10 @@ def method(self):
self._perform_method_overloading()
return self._method

@method.setter
def method(self, value):
self._method = value

@property
def content_type(self):
if not hasattr(self, '_content_type'):
Expand Down Expand Up @@ -138,7 +142,10 @@ def _perform_method_overloading(self):
Also provides support for browser non-form requests (eg JSON),
by specifing '_content' and '_content_type' form fields.
"""
self._method = super(APIRequest, self).method
try:
self._method = super(APIRequest, self).method
except AttributeError:
self._method = ''
self._stream = super(APIRequest, self).stream
self._content_type = self.headers.get('Content-Type')
self._content_length = get_content_length(self.environ)
Expand Down
2 changes: 1 addition & 1 deletion flask_api/tests/test_parsers.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ def test_invalid_multipart(self):
with self.assertRaises(exceptions.ParseError) as context:
parser.parse(stream, media_type, content_length=len('invalid'))
detail = str(context.exception)
expected = 'Multipart parse error - Expected boundary at start of multipart data'
expected = 'Multipart parse error - Invalid form-data cannot parse beyond State.PREAMBLE'
self.assertEqual(detail, expected)

def test_invalid_multipart_no_boundary(self):
Expand Down
0