diff --git a/CHANGELOG.md b/CHANGELOG.md index c4ccd70e..e9a1c86a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org). -## [Unreleased] +## 2.0.2 - 2020-01-12 #### Added @@ -25,6 +25,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com), and this #### Fixed * [#614](https://github.com/shlinkio/shlink/issues/614) Fixed `OPTIONS` requests including the `Origin` header not always returning an empty body with status 2xx. +* [#615](https://github.com/shlinkio/shlink/issues/615) Fixed query args with no value being lost from the long URL when users are redirected. ## 2.0.1 - 2020-01-10 diff --git a/config/autoload/common.local.php.dist b/config/autoload/common.local.php.dist index 9d1276c4..f29c74b0 100644 --- a/config/autoload/common.local.php.dist +++ b/config/autoload/common.local.php.dist @@ -1,4 +1,5 @@ [ +// 'base_path' => '', 'fastroute' => [ FastRouteRouter::CONFIG_CACHE_ENABLED => false, ], diff --git a/config/autoload/swoole.local.php.dist b/config/autoload/swoole.local.php.dist index 5e12a5a3..0c485690 100644 --- a/config/autoload/swoole.local.php.dist +++ b/config/autoload/swoole.local.php.dist @@ -1,8 +1,9 @@ logger = $logger ?: new NullLogger(); } - /** - * Process an incoming server request and return a response, optionally delegating - * to the next middleware component to create the response. - * - * - */ public function process(ServerRequestInterface $request, RequestHandlerInterface $handler): ResponseInterface { $shortCode = $request->getAttribute('shortCode', ''); @@ -79,7 +73,7 @@ abstract class AbstractTrackingAction implements MiddlewareInterface } $mergedQuery = array_merge($hardcodedQuery, $currentQuery); - return (string) $uri->withQuery(http_build_query($mergedQuery)); + return (string) $uri->withQuery(build_query($mergedQuery)); } abstract protected function createSuccessResp(string $longUrl): ResponseInterface; diff --git a/module/Core/test/Action/RedirectActionTest.php b/module/Core/test/Action/RedirectActionTest.php index 04705251..b7060a8e 100644 --- a/module/Core/test/Action/RedirectActionTest.php +++ b/module/Core/test/Action/RedirectActionTest.php @@ -64,6 +64,7 @@ class RedirectActionTest extends TestCase { yield ['http://domain.com/foo/bar?some=thing', []]; yield ['http://domain.com/foo/bar?some=thing', ['foobar' => 'notrack']]; + yield ['http://domain.com/foo/bar?some=thing&else', ['else' => null]]; yield ['http://domain.com/foo/bar?some=thing&foo=bar', ['foo' => 'bar']]; yield ['http://domain.com/foo/bar?some=overwritten&foo=bar', ['foo' => 'bar', 'some' => 'overwritten']]; yield ['http://domain.com/foo/bar?some=overwritten', ['foobar' => 'notrack', 'some' => 'overwritten']];