mmomtchev/sqlite-wasm-http

url is truncatured when url contain querystring

zyxgis opened this issue · 4 comments

You should use encodeURIComponent on your URL:

import { createSQLiteThread, createHttpBackend } from 'sqlite-wasm-http';

const httpBackend = createHttpBackend({
  maxPageSize: 1024,
  backendType: 'sync' || undefined,  // <- select one
  timeout: 45000
});
const msg = await createSQLiteThread({ http: httpBackend })
  .then((db) => db('open', {
    filename: 'file:' + encodeURIComponent(remoteURL),
    vfs: 'http'
  }));
assert.equal(msg.type, 'open');
assert.strictEqual(decodeURIComponent(msg.result.filename), 'file:' + remoteURL);

? has special meaning in SQLite, do not forget that SQLite does not have any notion of HTTP - for SQLite you simply pass a filename that SQLite passes to a VFS driver that expects an URL.

As you may have seen from my profile, I have been living on social welfare for the last 3 years - eating with a few euros per day - and I expect to lose my home in the coming months. This is because of an extortion involving the French police and judiciary which included people simultaneously posting messages with content related to my sex life at my previous two employers. Currently, I am being offered a new job only if I accept that people around me continue to do this - without me saying anything - and only if accept a job at an employer chosen by the organizers of the extortion - because most companies refuse to do this. In order to further intimidate me, people are posting simultaneously issues and pull requests in all of the projects that I work in.

You have posted this issue simultaneously with @sifat-at-work and I also got a phone call that hanged up after a few seconds. Is it because you are taking part in the extortion?

zyxgis commented

thank you for your help.
i don't know about this matter, i am just an ordinary software developer.

zyxgis commented

thank you for your help.

i don't know about this matter, i am just an ordinary software developer.