CSV and TAB format use wrong content-type
Bug #344788 reported by
Xavier Brochard
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Woda |
Fix Committed
|
Low
|
Xavier Brochard |
Bug Description
content-type for CSV, CSVS and TAB format is set to text/plain in Search and in Export
it should be set to text/CSV
concerns sub are
sub printSearchHttp
sub wbExport
woda 4x (at least)
Related branches
lp:~xavier/woda/4.620
- Woda: Pending requested
- Diff: 0 lines
Changed in woda: | |
assignee: | nobody → Xavier Brochard (xavier) |
status: | New → Confirmed |
importance: | Undecided → Medium |
importance: | Medium → Low |
Changed in woda: | |
status: | Confirmed → Fix Committed |
Changed in woda: | |
milestone: | none → merge-with-pro |
To post a comment you must log in.
I agree. We should be more specific about the header. It allows the browser to pass the content off to another application. At the least it would save the output as a file and that saves the user a step.
There is also the XMP issue with TAB format. Is XMP meant to be old HTML "example" tag or Adobe Extensible Metadata Platform? Can we remove it or is it needed?
sub printSearchHttp Header {
local ( $format, $yh, $yf ) = @_;
local ( $html, $x );
if ( $format =~ m/^(\d+)$/ && $WBB{"formatHtt pHead$1" } ne '' ) { pHead$1" }; Disposition: attachment; filename=\"woda export.csv\"\n\n" if $yh; separated- values\ n" if $yh; Disposition: attachment; filename=\"woda export.tsv\"\n\n" if $yh;
printXmlHead( ) if $yh;
$x = $WBB{"formatHtt
$x =~ s/\n*$//g; # remove trailing newlines
print "$x\n\n" if $yh;
$html = $yh = $yf = 0; # no more head or foot stuff for sure
}
elsif ( $format =~ m/^CSV/ ) {
print "Content-type: test/csv\n" if $yh;
print "Content-
$html = $yh = $yf = 0; # no more head of foot stuff for sure
}
elsif ( $format =~ m/^TAB$/ ) {
print "Content-type: text/tab-
print "Content-
$html = $yh = $yf = 0; # no more head of foot stuff for sure
}
elsif ( $format =~ m/^RAW$/ ) {
print "Content-type: text/plain\n\n" if $yh;
$html = $yh = $yf = 0; # no more head of foot stuff for sure
}
elsif ( $format =~ m/^XML/ ) {
$html = $yh = $yf = 0; # no more head of foot stuff for sure
}
elsif ( $format =~ m/^RSS/ ) {
print "Content-type: text/xml\n\n" if $yh;
$html = $yh = $yf = 0; # no more head of foot stuff for sure
}
else {
$html = 1;
}
return ( $html, $yh, $yf );
}