Files
flatpak/tests
Matthew Leeds 4e81789167 Consistently use flatpak_load_http_uri()
Currently Flatpak has a few different implementations of helper
functions to download a URI using libsoup, but the best one seems to be
in common/flatpak-utils-http.c. So this commit deletes the others and
makes use of flatpak_load_http_uri() in place of download_uri() in a
few places. This has a couple consequences:
1) It means that we're now properly checking HTTP status codes rather
than assuming that the request was successful, in the install command,
remote-add command, and in FlatpakTransaction. This fixes an assertion
failure seen by a user when they tried to use a flatpakref URL that hit
a 404.
2) It means that in the places where we're using flatpak_load_http_uri()
we are only supporting http:// and https:// URLs not, say, file:// ones.
For the install and remote-add commands this was already being enforced.
For the handling of flatpakref files and bundles in FlatpakTransaction,
I believe it's just convention because it doesn't make much sense to
do anything else; this commit enforces that convention.

Also, add a unit test for the case of trying to install a flatpakref at
a URL that hits a 404 error.

Fixes https://github.com/flatpak/flatpak/issues/2727

Closes: #2740
Approved by: matthiasclasen
2019-03-06 23:44:50 +00:00
..
2016-02-25 15:27:37 +01:00
2019-01-15 16:02:34 +01:00
2019-01-15 16:02:34 +01:00
2019-02-25 18:12:30 +00:00
2016-02-25 19:03:09 +01:00
2019-01-11 19:19:54 -05:00
2018-10-15 06:51:58 +00:00
2019-01-14 11:10:17 +00:00
2018-10-03 13:19:35 +00:00
2019-01-11 13:31:10 +00:00
2018-12-03 20:38:39 +00:00