diff --git a/config/autoload/url-shortener.global.php b/config/autoload/url-shortener.global.php index 58bc3faa..5cf4f86f 100644 --- a/config/autoload/url-shortener.global.php +++ b/config/autoload/url-shortener.global.php @@ -9,7 +9,7 @@ return [ 'schema' => 'https', 'hostname' => '', ], - 'validate_url' => true, + 'validate_url' => false, 'visits_webhooks' => [], ], diff --git a/config/test/test_config.global.php b/config/test/test_config.global.php index 0aeaea6d..a3b297b7 100644 --- a/config/test/test_config.global.php +++ b/config/test/test_config.global.php @@ -61,6 +61,7 @@ return [ 'schema' => 'http', 'hostname' => 'doma.in', ], + 'validate_url' => true, ], 'zend-expressive-swoole' => [ diff --git a/docker/README.md b/docker/README.md index 584e4e99..423ba8f8 100644 --- a/docker/README.md +++ b/docker/README.md @@ -103,7 +103,7 @@ This is the complete list of supported env vars: * **postgres** -> `5432` * `DISABLE_TRACK_PARAM`: The name of a query param that can be used to visit short URLs avoiding the visit to be tracked. This feature won't be available if not value is provided. * `DELETE_SHORT_URL_THRESHOLD`: The amount of visits on short URLs which will not allow them to be deleted. Defaults to `15`. -* `VALIDATE_URLS`: Boolean which tells if shlink should validate a status 20x (after following redirects) is returned when trying to shorten a URL. Defaults to `true`. +* `VALIDATE_URLS`: Boolean which tells if shlink should validate a status 20x is returned (after following redirects) when trying to shorten a URL. Defaults to `false`. * `INVALID_SHORT_URL_REDIRECT_TO`: If a URL is provided here, when a user tries to access an invalid short URL, he/she will be redirected to this value. If this env var is not provided, the user will see a generic `404 - not found` page. * `REGULAR_404_REDIRECT_TO`: If a URL is provided here, when a user tries to access a URL not matching any one supported by the router, he/she will be redirected to this value. If this env var is not provided, the user will see a generic `404 - not found` page. * `BASE_URL_REDIRECT_TO`: If a URL is provided here, when a user tries to access Shlink's base URL, he/she will be redirected to this value. If this env var is not provided, the user will see a generic `404 - not found` page. @@ -137,7 +137,7 @@ docker run \ -e DB_PORT=3306 \ -e DISABLE_TRACK_PARAM="no-track" \ -e DELETE_SHORT_URL_THRESHOLD=30 \ - -e VALIDATE_URLS=false \ + -e VALIDATE_URLS=true \ -e "INVALID_SHORT_URL_REDIRECT_TO=https://my-landing-page.com" \ -e "REGULAR_404_REDIRECT_TO=https://my-landing-page.com" \ -e "BASE_URL_REDIRECT_TO=https://my-landing-page.com" \ @@ -163,7 +163,7 @@ The whole configuration should have this format, but it can be split into multip "delete_short_url_threshold": 30, "short_domain_schema": "https", "short_domain_host": "doma.in", - "validate_url": false, + "validate_url": true, "invalid_short_url_redirect_to": "https://my-landing-page.com", "regular_404_redirect_to": "https://my-landing-page.com", "base_url_redirect_to": "https://my-landing-page.com", diff --git a/docker/config/shlink_in_docker.local.php b/docker/config/shlink_in_docker.local.php index 5b4db1e1..5b9d5547 100644 --- a/docker/config/shlink_in_docker.local.php +++ b/docker/config/shlink_in_docker.local.php @@ -86,7 +86,7 @@ return [ 'schema' => env('SHORT_DOMAIN_SCHEMA', 'http'), 'hostname' => env('SHORT_DOMAIN_HOST', ''), ], - 'validate_url' => (bool) env('VALIDATE_URLS', true), + 'validate_url' => (bool) env('VALIDATE_URLS', false), 'visits_webhooks' => $helper->getVisitsWebhooks(), ], diff --git a/module/Core/test/Config/SimplifiedConfigParserTest.php b/module/Core/test/Config/SimplifiedConfigParserTest.php index d1b27302..c608a44f 100644 --- a/module/Core/test/Config/SimplifiedConfigParserTest.php +++ b/module/Core/test/Config/SimplifiedConfigParserTest.php @@ -38,7 +38,7 @@ class SimplifiedConfigParserTest extends TestCase 'disable_track_param' => 'bar', 'short_domain_schema' => 'https', 'short_domain_host' => 'doma.in', - 'validate_url' => false, + 'validate_url' => true, 'delete_short_url_threshold' => 50, 'invalid_short_url_redirect_to' => 'foobar.com', 'redis_servers' => [ @@ -79,7 +79,7 @@ class SimplifiedConfigParserTest extends TestCase 'schema' => 'https', 'hostname' => 'doma.in', ], - 'validate_url' => false, + 'validate_url' => true, 'visits_webhooks' => [ 'http://my-api.com/api/v2.3/notify', 'https://third-party.io/foo',