404 with _custom_actions

72 views
Skip to first unread message

Lucas Alvares Gomes

unread,
Jul 31, 2013, 6:33:02 AM7/31/13
to peca...@googlegroups.com
Hi

I'm getting a 404 when doing a GET on a nested resource _if_ the URL ends with a  '/'. My implementation looks like:

class Controller(rest.RestController):

    _custom_actions = {
        'nested': ['GET'],
    }

...

    @wsme_pecan.wsexpose(unicode, unicode)
    def nested(self, id):
        return "test"

So when GET'ing my custom action it acts like:

$ curl -X GET "http://localhost:6385/v1/resource/1/nested"
localhost.localdomain - - [31/Jul/2013 11:10:03] "GET /v1/resource/1/nested HTTP/1.1" 200 3
"test"

$ curl -X GET "http://localhost:6385/v1/resource/1/nested/"
localhost.localdomain - - [31/Jul/2013 11:10:05] "GET /v1/resource/1/nested/ HTTP/1.1" 404 186
{"error_message": "<html>\n <head>\n  <title>404 Not Found</title>\n </head>\n <body>\n  <h1>404 Not Found</h1>\n  The resource could not be found.<br /><br />\n\n\n\n </body>\n</html>"}

The versions of pecan and WSME I'm using are:

$ pip list | grep pecan
pecan (0.3.1)
$ pip list | grep WSME
WSME (0.5b2)

Did I do something wrong with the implementation? Can someone confirm if it's a bug?

Cheers,
Lucas

ryan.p...@dreamhost.com

unread,
Aug 9, 2013, 2:12:17 PM8/9/13
to peca...@googlegroups.com
Lucas,

It looks like this could be a bug.  Would you mind filing an issue in Github?

Reply all
Reply to author
Forward
0 new messages