mirror of
https://github.com/shlinkio/shlink.git
synced 2025-03-29 13:03:52 +03:00
Fix dependency injected in CrawlingHelper
This commit is contained in:
parent
ad44a8441a
commit
70c1c9f018
5 changed files with 51 additions and 2 deletions
17
CHANGELOG.md
17
CHANGELOG.md
|
@ -4,6 +4,23 @@ 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).
|
The format is based on [Keep a Changelog](https://keepachangelog.com), and this project adheres to [Semantic Versioning](https://semver.org).
|
||||||
|
|
||||||
|
## [Unreleased]
|
||||||
|
### Added
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Changed
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Deprecated
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Removed
|
||||||
|
* *Nothing*
|
||||||
|
|
||||||
|
### Fixed
|
||||||
|
* [#1698](https://github.com/shlinkio/shlink/issues/1698) Fixed error 500 in `robots.txt`.
|
||||||
|
|
||||||
|
|
||||||
## [3.5.1] - 2023-02-04
|
## [3.5.1] - 2023-02-04
|
||||||
### Added
|
### Added
|
||||||
* *Nothing*
|
* *Nothing*
|
||||||
|
|
|
@ -187,7 +187,7 @@ return [
|
||||||
Util\DoctrineBatchHelper::class,
|
Util\DoctrineBatchHelper::class,
|
||||||
],
|
],
|
||||||
|
|
||||||
Crawling\CrawlingHelper::class => ['em'],
|
Crawling\CrawlingHelper::class => [ShortUrl\Repository\CrawlableShortCodesQuery::class],
|
||||||
],
|
],
|
||||||
|
|
||||||
];
|
];
|
||||||
|
|
31
module/Core/test-api/Action/RobotsTest.php
Normal file
31
module/Core/test-api/Action/RobotsTest.php
Normal file
|
@ -0,0 +1,31 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
declare(strict_types=1);
|
||||||
|
|
||||||
|
namespace ShlinkioApiTest\Shlink\Core\Action;
|
||||||
|
|
||||||
|
use Shlinkio\Shlink\TestUtils\ApiTest\ApiTestCase;
|
||||||
|
|
||||||
|
class RobotsTest extends ApiTestCase
|
||||||
|
{
|
||||||
|
/** @test */
|
||||||
|
public function expectedListOfCrawlableShortCodesIsReturned(): void
|
||||||
|
{
|
||||||
|
$resp = $this->callShortUrl('robots.txt');
|
||||||
|
$body = $resp->getBody()->__toString();
|
||||||
|
|
||||||
|
self::assertEquals(200, $resp->getStatusCode());
|
||||||
|
self::assertEquals(
|
||||||
|
<<<ROBOTS
|
||||||
|
# For more information about the robots.txt standard, see:
|
||||||
|
# https://www.robotstxt.org/orig.html
|
||||||
|
|
||||||
|
User-agent: *
|
||||||
|
Allow: /custom
|
||||||
|
Allow: /abc123
|
||||||
|
Disallow: /
|
||||||
|
ROBOTS,
|
||||||
|
$body,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
|
@ -122,7 +122,7 @@ class ListShortUrlsTest extends ApiTestCase
|
||||||
],
|
],
|
||||||
'domain' => null,
|
'domain' => null,
|
||||||
'title' => null,
|
'title' => null,
|
||||||
'crawlable' => false,
|
'crawlable' => true,
|
||||||
'forwardQuery' => false,
|
'forwardQuery' => false,
|
||||||
];
|
];
|
||||||
private const SHORT_URL_CUSTOM_DOMAIN = [
|
private const SHORT_URL_CUSTOM_DOMAIN = [
|
||||||
|
|
|
@ -62,6 +62,7 @@ class ShortUrlsFixture extends AbstractFixture implements DependentFixtureInterf
|
||||||
'maxVisits' => 2,
|
'maxVisits' => 2,
|
||||||
'apiKey' => $authorApiKey,
|
'apiKey' => $authorApiKey,
|
||||||
'longUrl' => 'https://shlink.io',
|
'longUrl' => 'https://shlink.io',
|
||||||
|
'crawlable' => true,
|
||||||
'forwardQuery' => false,
|
'forwardQuery' => false,
|
||||||
])), '2019-01-01 00:00:20');
|
])), '2019-01-01 00:00:20');
|
||||||
$manager->persist($customShortUrl);
|
$manager->persist($customShortUrl);
|
||||||
|
|
Loading…
Add table
Reference in a new issue