Closed corneliusroemer closed 6 months ago
downloadAsFile=false
essentially does nothing. I will investigate why this happens...
Did you by any chance also archive what the response for the old link looked like (most importantly the headers)?
It's just a list of accessions, something like:
EPI_ISL_18861300
EPI_ISL_18832067
EPI_ISL_18763358
EPI_ISL_18782686
I'm not sure I have an archive, let me check!
Unfortunately I couldn't find any full requests in web archive.
https://lapis.cov-spectrum.org/open/v1/sample/genbank-accession?dataFormat=csv&limit=100
has content-disposition: inline
set. That's likely it.
content-disposition: inline
doesn't do it. If Content-Type: text/csv
or Content-Type: text/tab-separated-values
, then browsers refuse to display it and instead download the data.
LAPIS 1 solves this by setting Content-Type: text/plain
for those specific endpoints that fetch accession lists.
How should we handle this in LAPIS 2? Our routing depends on the Accept
and Content-Type
header, so this might be difficult to overwrite. Also we don't have specific endpoints, but abuse /details
here.
Content-Type: text/plain
if downloadAsFile
is explicitly set to false
?It is a useful feature that people use and enjoy, so we should support it.
What's about setting the Content-Type
to text/plain
for dataFormat=CSV-WITHOUT-HEADERS
?
What's about setting the Content-Type to text/plain for dataFormat=CSV-WITHOUT-HEADERS?
Sounds like a possible solution. That data format is quite specific for that use case anyway. Or should we introduce yet another data format?
I deployed the necessary changes, works for me in Firefox:
Excellent, yes works for me too!
There seems to be a regression for feature #444 in that the accessions are downloaded rather than opened in new file.
This is probably because there's no longer a
downloadAsFile=false
URL parameter.Old link: https://lapis.cov-spectrum.org/gisaid/v1/sample/gisaid-epi-isl?host=Human®ion=Europe&dateFrom=2021-09-27&nucMutations=2470T%2C13195C%2CG27382C%2CA29510C%2CC26858T%2CA27383T&downloadAsFile=false&dataFormat=csv
New link: https://lapis.cov-spectrum.org/gisaid/v2/sample/details?country=Switzerland&dateFrom=2023-08-21&dateTo=2024-02-15&nextcladePangoLineage=ba.2.86*&host=Human&dataFormat=CSV-WITHOUT-HEADERS&accessKey=9Cb3CqmrFnVjO3XCxQLO6gUnKPd&fields=gisaidEpiIsl
See https://neherlab.slack.com/archives/C01M74N29RD/p1708616351775129