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

cherrpypy popargs breaks file extension handling #1988

Open
ikus060 opened this issue Feb 6, 2023 · 0 comments
Open

cherrpypy popargs breaks file extension handling #1988

ikus060 opened this issue Feb 6, 2023 · 0 comments

Comments

@ikus060
Copy link

ikus060 commented Feb 6, 2023

Sorry to revive this old bug report #1413

I'm using cherrypy v18.8.0 and I still have the same problem. It seams the proposed change never made it to master: 403fe60

import cherrypy


@cherrypy.popargs('id')
class Person:
    @cherrypy.expose
    def index(self, id=None):
        if id:
            return 'FOO'
        return 'BAR'

    @cherrypy.expose('data.json')
    @cherrypy.tools.json_out()
    def data_json(self, id=None, **kwargs):
        if id:
            return {'a': 'foo'}
        return {'a': 'bar'}


class Root:
    person = Person()

    @cherrypy.expose
    def index(self, id=None):
        return 'index'


cherrypy.quickstart(root=Root())

The following URL return the expected result:

http://127.0.0.1:8080/
http://127.0.0.1:8080/person/
http://127.0.0.1:8080/person/5/
http://127.0.0.1:8080/person/data.json

But the following URL return 404
http://127.0.0.1:8080/person/5/data.json

Simply because the vpath contains '.' that is not replaced by underscore (_)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant