mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) add a deployment test for Import-from-URL, and fix underlying issue
Summary: * Adds a simple deployment test for the "Import from URL" button. * Makes server aware of plugin hostnames in the appropriate places. * Unrelated but convenient: allows following redirection when importing. Test Plan: Added tests. The `local_deployment` test works. A modified version of this works against `staging_deployment` (using a test url that doesn't require redirection; also staging currently has a hot fix that can hopefully be removed once the code fix included here is in). Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2556
This commit is contained in:
@@ -346,7 +346,11 @@ export async function fetchURL(url: string, accessId: string|null): Promise<Uplo
|
||||
*/
|
||||
async function _fetchURL(url: string, accessId: string|null, fileName: string,
|
||||
headers?: {[key: string]: string}): Promise<UploadResult> {
|
||||
const response: FetchResponse = await Deps.fetch(url, {headers});
|
||||
const response: FetchResponse = await Deps.fetch(url, {
|
||||
redirect: 'follow',
|
||||
follow: 10,
|
||||
headers
|
||||
});
|
||||
await _checkForError(response);
|
||||
if (fileName === '') {
|
||||
const disposition = response.headers.get('content-disposition') || '';
|
||||
|
||||
Reference in New Issue
Block a user