From cc2bdc603f61f139af5d9fb23d481f1b18488afe Mon Sep 17 00:00:00 2001 From: David Tucker Date: Thu, 15 Feb 2024 21:38:40 +0000 Subject: [PATCH] Redirect to a raw txt retrieval from the Web UI Currently we redirect to a Web render; however, if libmagic guesses a type that the browser cannot render, the browser will try to download the paste, which makes it difficult to get a link to the paste. This makes it so the Web UI redirects to a raw txt render. The user can make it prettier my manually adjusting the URL if they choose. --- pbnh/templates/index.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pbnh/templates/index.html b/pbnh/templates/index.html index 3abbf41..2d037be 100644 --- a/pbnh/templates/index.html +++ b/pbnh/templates/index.html @@ -5,7 +5,7 @@ var xhttp = new XMLHttpRequest(); xhttp.onreadystatechange = function() { if (xhttp.readyState == 4 && xhttp.status == 201 && xhttp.responseText.length) { - window.location.href = JSON.parse(xhttp.responseText).link; + window.location.href = JSON.parse(xhttp.responseText).link + ".txt"; } }; var myForm = new FormData();