datasette-publish-vercel icon indicating copy to clipboard operation
datasette-publish-vercel copied to clipboard

Query page .csv and .json links are not correctly URL-encoded on Vercel under unknown specific conditions

Open simonw opened this issue 2 years ago • 8 comments

Confirmed: https://thesession.vercel.app/thesession?sql=select+*+from+tunes+where+name+like+%22%25wise+maid%25%22%0D%0A is a page where the URL correctly encoded % as %25 - but then in the HTML on that page that links to the CSV and JSON versions we get this:

<p class="export-links">This data as
  <a href="/thesession.json?sql=select * from tunes where name like &#34;%wise maid%&#34;">json</a>,
  <a href="/thesession.csv?sql=select * from tunes where name like &#34;%wise maid%&#34;&amp;_size=max">CSV</a>
</p>

Those CSV and JSON links are incorrect.

Originally posted by @simonw in https://github.com/simonw/datasette-publish-vercel/issues/48#issuecomment-900497579

simonw avatar Aug 17 '21 17:08 simonw