-
Notifications
You must be signed in to change notification settings - Fork 151
Description
Hi,
The problem:
I use Capacitor/SQLite in the contexte of an Ionic application.
This app makes HTTPS requests to a Convertigo REST API to get .zip or .db files.
Convertigo is designed to get binary files with URL ending with .bin extension only, but the SQLite plugin only supports .zip and .db extension when using "GetFromHTTPRequest" to init a database with remote content.
New expected behaviour:
I would like implementation of "GetFromHTTPRequest" to check the extension of the provided URL, and in case it is '.bin' download the file and check first 4 bytes to determine it is zip or not.
Therefore The Convertigo will accept URL extension, and SQLite plugin will unzip or not the received file whether it is detected as zip content or not.
Alternative:
Convertigo server can implement a URL mapping to change extension from .zip to .bin, thus allowing to get files without any change in the Capacitor plugin. Nevertheless, this configuration shall be avoided, and Capacitor would benefit from the autodetect new feature.
The existing pull request:
I already implemented the solution this forked repository:
https://github.com/patrick-99/sqlite/tree/feat/convertigo-support
I also made the same changes to support .bin extension in the Jeep plugin:
https://github.com/patrick-99/jeep-sqlite/tree/feat/convertigo-support
cheers,
Patrick.