Summary: | Warning from runreport.pl 'Explicitly setting a MIME header field (content-type) is dangerous' | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Command-line Utilities | Assignee: | Arthur Suzuki <arthur.suzuki> |
Status: | RESOLVED DUPLICATE | QA Contact: | Testopia <testopia> |
Severity: | normal | ||
Priority: | P5 - low | CC: | arthur.suzuki, jonathan.druart, koha, m.de.rooy, robin |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
Change sponsored?: | --- | Patch complexity: | --- |
Documentation contact: | Documentation submission: | ||
Text to go in the release notes: | Version(s) released in: | ||
Circulation function: | |||
Attachments: |
Bug 22838: Remove MIME header warnings from runreports.pl
Bug 22838: Remove MIME header warnings from runreports.pl Bug 22838: Specify a content-type for other formats |
Description
Nick Clemens (kidclamp)
2019-05-03 14:26:13 UTC
Created attachment 96383 [details] [review] Bug 22838: Remove MIME header warnings from runreports.pl Test plan: - create a savedsql report - run misc/cronjob/runreport.pl with options --format set to html and --to any email - check plack errors log, you should get a warning - apply patch - repeat runreport.pl step - check plack errors log, no additional warning there should be Created attachment 96515 [details] [review] Bug 22838: Remove MIME header warnings from runreports.pl Test plan: - create a savedsql report - run misc/cronjob/runreport.pl with options --format set to html and --to any email - check plack errors log, you should get a warning - apply patch - repeat runreport.pl step - check plack errors log, no additional warning there should be Signed-off-by: Nick Clemens <nick@bywatersolutions.com> Created attachment 96641 [details] [review] Bug 22838: Specify a content-type for other formats (In reply to Jonathan Druart from comment #3) > Created attachment 96641 [details] [review] [review] > Bug 22838: Specify a content-type for other formats What about this patch? Should not we set content-type for other formats as well? Looking here $msg->attr("content-type" => $contenttype); See first comment. This is not recommended. Normally you use Type in MIME::Lite. Furthermore it seems that the same content-type now is applied to both message and attachment. Obviously, they could be different and should be handled individually. This needs some more attention. When we run runreport.pl with format option as html (koha version 19.11), we still obtain this warning : "Explicitly setting a MIME header field (content-type) is dangerous: use the attr() method instead. at runreport.pl line 326" We don't get it with format=csv. Olivier Crouzet Hello, could someone have a look at this one? Thanks, Sonia On master: kohadev-koha@kohadevbox:/kohadevbox/koha$ perl misc/cronjobs/runreport.pl 2 --format html --to foo@example.org It does not return any warnings. Certainly fixed by bug 22343. *** This bug has been marked as a duplicate of bug 22343 *** |