cuba-platform / reports

CUBA Reports Addon
https://www.cuba-platform.com/
Apache License 2.0
9 stars 4 forks source link

Nothing is shown after running or exporting reports creating by Report Wizard #177

Open Ann-Kh opened 5 years ago

Ann-Kh commented 5 years ago

Environment

Description of the bug or enhancement

Report Wizard automatically generate report name and output name pattern with double quotes. If there are double quotes in the output name pattern, neither report or error message will be shown. If there are double quotes in report name, the report can't be exported.

Steps:

  1. Run report with double quotes in the output name pattern

Steps:

  1. Run report with double quotes in report name
Quicksy commented 5 years ago

This happens when CUBA is behind http-proxy. What happens here is: When browser sends request like %domain%/app/APP/connector/0/2/download-05708dd0-55aa-4520-84a6-e782af4925bc/Report+for+entity+"Airport".docx (in this URL, Report+for+entity+"Airport".docx is the name of resulting report file) It knows that it have to replace " with %22 in URL for HTTP-conventions's sake.

If browser send this request (with %22 instead of " ) directly to Tomcat - Tomcat can handle this successfully and Report will be downloaded.

But when you have NGINX (or Apache) http-proxy in front of tomcat, browser sends request with %22 to proxy, proxy knows that %22 means ", normalize URL for having " in it, and send this request to Tomcat. But Tomcat just cannot handle such requests, and would reply only with HTTP 400 Bad Request response (for user it looks like nothing happened).

Please note, that in normal situation, you simply cannot create file with " in its name and upload it as template file. But CUBA Reporting wizard automatically creates reports with such "impossible" template-file names and this behavior leads to the issue above.