Skip to content

Commit

Permalink
Redirect to a raw txt retrieval from the Web UI
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tucked committed Feb 15, 2024
1 parent 5abdbe7 commit cc2bdc6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pbnh/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit cc2bdc6

Please sign in to comment.