Skip to content
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

Support per-view custom methods #1045

Closed
tumb1er opened this issue Aug 5, 2016 · 5 comments
Closed

Support per-view custom methods #1045

tumb1er opened this issue Aug 5, 2016 · 5 comments
Labels

Comments

@tumb1er
Copy link
Contributor

tumb1er commented Aug 5, 2016

Long story short

I'm trying to implement DAV protocol over aiohttp, and for custom HTTP-methods like MKCOL, PROPFIND I'm receiving 405 Method Not Allowed.

Expected behaviour

web.View is able to define extra supported methods, not listed in web.hdrs.METH_ALL

Actual behaviour

@asyncio.coroutine
    def __iter__(self):
        if self.request.method not in hdrs.METH_ALL:
            self._raise_allowed_methods()

Steps to reproduce

Implement ANY method not listed in hdrs.METH_ALL

Your environment

python3.5 aiohttp 0.22.5

@tumb1er
Copy link
Contributor Author

tumb1er commented Aug 5, 2016

I think, that's enough:

class View:
    METHODS = hdrs.METH_ALL
    @asyncio.coroutine
    def __iter__(self):
        if self.request.method not in self.METHODS:
            self._raise_allowed_methods()
        ...

@asvetlov
Copy link
Member

It's fixed by #1037 isn't it?

@tumb1er
Copy link
Contributor Author

tumb1er commented Aug 11, 2016

That's it. Is #1037 released?

@asvetlov
Copy link
Member

Not yet.
Please wait for aiohttp 1.0.
I'm planing to release in a couple weeks.

@lock
Copy link

lock bot commented Oct 29, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants