encodeURIComponent is how we spell escape in this century

from thinegen
This commit is contained in:
Ted Unangst 2023-01-04 13:51:07 -05:00
parent 077f37d46c
commit c92ad40a10
2 changed files with 2 additions and 2 deletions

View File

@ -2,7 +2,7 @@ function encode(hash) {
var s = [] var s = []
for (var key in hash) { for (var key in hash) {
var val = hash[key] var val = hash[key]
s.push(escape(key) + "=" + escape(val)) s.push(encodeURIComponent(key) + "=" + encodeURIComponent(val))
} }
return s.join("&") return s.join("&")
} }

View File

@ -6,7 +6,7 @@ export function addguesscontrols(elem, word, wordlist, xid) {
host.guesses = [] host.guesses = []
host.xid = xid host.xid = xid
var xhr = new XMLHttpRequest() var xhr = new XMLHttpRequest()
xhr.open("GET", "/bloat/wonkles?w=" + escape(wordlist)) xhr.open("GET", "/bloat/wonkles?w=" + encodeURIComponent(wordlist))
xhr.responseType = "json" xhr.responseType = "json"
xhr.onload = function() { xhr.onload = function() {
var wordlist = xhr.response.wordlist var wordlist = xhr.response.wordlist