-
-
Notifications
You must be signed in to change notification settings - Fork 744
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
post_internal fails when using URL_PREFIX or API_VERSION #810
Comments
Hello, thanks for reporting this.
I tried reproducing by adding the following test: def test_post_internal_with_url_prefix_or_api_version(self):
self.app.config['URL_PREFIX'] = 'test_api'
with self.app.test_request_context():
post_internal(self.known_resource, {'firstname': 'Test', 'lastname': 'Name'}) Test however passes with BasicAuth and also with no auth at all. |
Hi,
.. which should cover at least some of the tests since they use tox, correct? Just for the sake of completeness I also cloned the eve master branch and inserted your test and ran it manually and it passes for me too (python 3.4 and 3.5). Could it have something to do with the way the database testing envorinment is set up? I forked the eve-demo repository to make clearer what is being done to trigger the error. The diff is here: |
- tests sub-issue of pyeve#810 - After initializing the eve app, changing the url prefix should result in the resulting api urls changing accordingly.
- tests sub-issue of pyeve#810 - After initializing the eve app, changing the url prefix should result in the resulting api urls changing accordingly.
- tests sub-issue of pyeve#810 - After initializing the eve app, changing the url prefix should result in the resulting api urls changing accordingly.
- tests sub-issue of pyeve#810 - After initializing the eve app, changing the url prefix should result in the resulting api urls changing accordingly.
Just another update: app.config['URL_PREFIX'] = 'api' after the app is initialized does not actually set the url prefix. To clarify:
Hope this helps. Sorry for the patchwork bugreport. |
I can confirm that the original report is still an issue on Eve 0.6.4. Is there any indication as to when this is going to be fixed? |
Yes same for me Eve (0.6.4) Anyone could suggest workaround? |
Ok i got it. as you can see there is
And it works fine on first look. I tried it on my testing environment, will try for the whole system. |
@istinspring thanks for the workaround, we've been using it on Blender Cloud for a while now and it works fine. @nicolaiarocci what is the status of this issue? Is it going to be fixed, and if so, when can we expect the fix to be released? |
Hi folks, sorry for taking so long. Working on it. |
Eve 0.7.4 is out with a fix for this. Enjoy! |
@nicolaiarocci thank you! |
When setting
URL_PREFIX
option to a non-null value, thepost_internal
fails with aTypeError
.I first tried this on my own API but rechecked it in
eve-demo
which yields the error and traceback:To reproduce, add
to
settings.py
and addafter
app = Eve()
inrun.py
.It seems that
flask.request
is set toNone
in this case but up until now I can't figure out why.The text was updated successfully, but these errors were encountered: