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

Error message from server contains extraneous markup #915

Closed
gmlnchv opened this issue Feb 15, 2019 · 9 comments · Fixed by #1138
Closed

Error message from server contains extraneous markup #915

gmlnchv opened this issue Feb 15, 2019 · 9 comments · Fixed by #1138

Comments

@gmlnchv
Copy link

gmlnchv commented Feb 15, 2019

Overview

Error messages that come straight from the server are not readable to the CMS user.

One example is PDF files exceeding the specified maximum file size (for the server) seem to have some extraneous markup surrounding the error message.

screen shot 2019-02-15 at 2 37 57 pm

Recreation steps

  1. Use a project hosted on Silverstripe Cloud (e.g. demo.silverstripe.org)
  2. Upload a 13mb image to asset-admin
  3. Observe error

Acceptance criteria

  • Where the error message/ response comes straight from the server, exclude any HTML tags, ensuring the messaging is readable
  • Look at the common status codes and create a specific error message, or default to a generic error message
  • If any new translation strings are introduced, ensure they're pushed to Transifex

Notes

@robbieaverill
Copy link
Contributor

Oh, that's probably coming from your web server (apache/nginx)! Is this reproducible on a vanilla installation by posting an enormous file at it? Could you please share some information about the versions you're running as well as any custom config, web server config etc? If you're running nginx especially

@gmlnchv
Copy link
Author

gmlnchv commented Feb 15, 2019

@robbieaverill you are right - I could only reproduce this on SilverStripe Platform. Fresh SS4 installation doesn't seem to have this :) Should probably close and raise with the Platform instead?

@robbieaverill
Copy link
Contributor

@gmlnchv I think you can leave the issue open, but maybe raise a helpdesk issue and reference this GitHub issue in it

@chillu
Copy link
Member

chillu commented Feb 18, 2019

The frontend logic should be looking at the status code as well as the content type of the response. If it's text/html, then don't use it. If it's application/json, then try to parse it for error messages. If it's text/plain, display it. In all cases, the output should be sanitised.

@gmlnchv
Copy link
Author

gmlnchv commented Apr 20, 2019

@gmlnchv I think you can leave the issue open, but maybe raise a helpdesk issue and reference this GitHub issue in it

@robbieaverill Still worthwhile raising with the helpdesk or can be fixed here you think?

@robbieaverill
Copy link
Contributor

@gmlnchv I would suggest raising a ticket and reference this issue

@robbieaverill
Copy link
Contributor

This is still an issue. I replicated earlier today by uploading a 13mb image to asset-admin on demo.silverstripe.org.

@brynwhyman brynwhyman changed the title Error message when adding large PDF files contains extraneous markup Error message from server contains extraneous markup Sep 6, 2020
@emteknetnz emteknetnz self-assigned this Sep 14, 2020
@emteknetnz emteknetnz added this to the Sprint 67 milestone Sep 14, 2020
@emteknetnz emteknetnz linked a pull request Sep 15, 2020 that will close this issue
1 task
@emteknetnz
Copy link
Member

Fixed in #1138

@emteknetnz emteknetnz removed their assignment Sep 15, 2020
@gmlnchv gmlnchv closed this as completed Sep 15, 2020
@emteknetnz
Copy link
Member

Re-opening, linked PR hasn't been merged yet

@emteknetnz emteknetnz reopened this Sep 15, 2020
@bergice bergice modified the milestones: Sprint 67, Sprint 68 Sep 15, 2020
@emteknetnz emteknetnz removed their assignment Sep 16, 2020
@Cheddam Cheddam assigned emteknetnz and unassigned Cheddam Sep 22, 2020
@emteknetnz emteknetnz assigned Cheddam and unassigned emteknetnz Sep 22, 2020
@Cheddam Cheddam removed their assignment Sep 23, 2020
@Cheddam Cheddam closed this as completed Sep 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants