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

Fix 500 errors when missing theme CSS is requested #878

Merged
merged 1 commit into from
Mar 11, 2019

Conversation

brian-kephart
Copy link
Collaborator

I've been getting a few 500 errors when my CDN requests expired theme asset files. This is caused by CamaleonController#render_error looking for a template to render instead of just returning a 404 header. This pull request preserves existing behavior for HTML and returns a 404 status for other request types.

This is not the only possible fix. If you'd prefer to only alter behavior for CSS, it can be done like this instead:

respond_to do |format|
  format.css { head status }
  format.any { render "camaleon_cms/#{status}", :status => status }
end

But I thought better to make the change for any request type that is not rendering an HTML page.

Yet another option would be to create a blank CSS file in the directory so there's something to render.

@owen2345 owen2345 merged commit 7de096f into owen2345:master Mar 11, 2019
tostasqb pushed a commit to shermanstravel/camaleon-cms that referenced this pull request Mar 11, 2019
brian-kephart added a commit to brian-kephart/camaleon-cms that referenced this pull request Mar 11, 2019
owen2345 added a commit that referenced this pull request Mar 11, 2019
apply fix in #878 when site has a custom error page
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

Successfully merging this pull request may close these issues.

2 participants