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

Mezzanine returns 200 for non-existent subpages. #1090

Closed
klebed opened this issue Aug 9, 2014 · 6 comments
Closed

Mezzanine returns 200 for non-existent subpages. #1090

klebed opened this issue Aug 9, 2014 · 6 comments

Comments

@klebed
Copy link

klebed commented Aug 9, 2014

Hi!

I've found strange bug with lastest mezzanine instalations. It is not handling 404 for subpages of subpages.
Example:
/ - will return 200 and show main page (right behaviour)
/fjshdkjhfkjds/ - will return 404 (right behaviour)
/existent-page/ - will return 200 and show existent-page page (right behaviour)
/existent-page/glkjfdgkljfd/ - will return 200 and show existent-page page (wrong!)
/existent-page/glkjfdgkljfd/kjlksajjsk/ - will return 200 and show existent-page page (wrong!)

and so-on.
was checked with multiple projects on newly created virtualenvs.

@stephenmcd
Copy link
Owner

Thanks for the report.

@klebed
Copy link
Author

klebed commented Aug 9, 2014

WOW! That's was fast! =)
Frankly speaking i've tried to look into code, but due to lack of experience in mezzanine failed to determine where problem is.
Thank you so much!

@AlexHill
Copy link
Collaborator

Hmm. I guess it's hard to argue that this is not a valid bug, but I was making use of it – using the part of the slug following the page's slug as a kind of query string in a page processor (in the same way as a third-party app mounted in Mezzanine's page tree might).

One way to allow this kind of thing would be to run the page processors before calling the page view. That way you can just skip Mezzanine's page view by returning a response from your processor. Does that sound reasonable Steve?

@klebed
Copy link
Author

klebed commented Aug 12, 2014

Hi, Alex! You can allways catch request before it go to a page processor, and direct it to whatever you want. But default behaviour should be straightforward, because otherwise it becomes confusing. If page not exist, CMS should return 404, because it is a special code for non-existent content, it's a standard.

@stephenmcd
Copy link
Owner

Alex that sounds like a great solution

@AlexHill
Copy link
Collaborator

OK, I'll submit a patch shortly. It has the added bonus of not generating a response for the regular page view if it's never going to be seen.

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

3 participants