Closed mansueli closed 1 year ago
I wonder whether this is to do with how Dart URI handles query strings differently to how JS does. I'll add a test case.
I think you need to url encode your '#'s in your URL, your URL in any browser will drop any params after the first hash since it will treat it as a hash/location id;
e.g.
const u = new URL("https://jpzwvyukydqlzwgvncyj.functions.supabase.co/dart_edge?pattern=surf&height=800&text=generate%20images%20with%20dart%20edge&pcolor=#100000&scolor=#FFF&text_color=#FF0000")
console.log(u.hash); // '#100000&scolor=#FFF&text_color=#FF0000'
console.log(u.searchParams.toString()); // 'pattern=surf&height=800&text=generate+images+with+dart+edge&pcolor='
But if your hashes are URL encoded then it works as expected:
const u2 = new URL("https://jpzwvyukydqlzwgvncyj.functions.supabase.co/dart_edge?pattern=surf&height=800&text=generate%20images%20with%20dart%20edge&pcolor=%23100000&scolor=%23FFF&text_color=%23FF0000")
console.log(u2.hash); // ''
console.log(u2.searchParams.toString()); // 'pattern=surf&height=800&text=generate+images+with+dart+edge&pcolor=%23100000&scolor=%23FFF&text_color=%23FF0000'
I've deployed this after compiling it with
edge build supabase_functions --dev
as the main isn't working.However , I expected to get all the query params with the following call:
For example a call to:
Should return:
I get the following:
Another example as it seems that terms disappear and even get swapped randomly:
Expected results:
Actual results: