Bug #88958
Linkvalidator: incorrect range specification
100%
Description
EXT:linkvalidator/Classes/Linktype/ExternalLinktype.php
, function checkLink
near line 88:
// HEAD was not allowed or threw an error, now trying GET $options['headers']['Range'] = 'bytes = 0 - 4048'; $isValidUrl = $this->requestUrl($url, 'GET', $options);
According to RFC 7233 there can be no spaces in range specification. Some web servers strictly follow this and throw a 416 http error.
Simple remove spaces like this:
// HEAD was not allowed or threw an error, now trying GET $options['headers']['Range'] = 'bytes=0-4048'; $isValidUrl = $this->requestUrl($url, 'GET', $options);
Associated revisions
[BUGFIX] Incorrect HTTP range specification in Linkvalidator
Range specifications in HTTP may not include spaces. While many
web servers tolerate them, some return a 416 HTTP error. This
change makes range request from Linkvalidator to follow RFC 7233.
Resolves: #88958
Releases: master, 9.5, 8.7
Change-Id: I06fe31ab9db1a0391853f21ce28cb92be0b5656d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61496
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Georg Ringer <georg.ringer@gmail.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Georg Ringer <georg.ringer@gmail.com>
Reviewed-by: Oliver Klee <typo3-coding@oliverklee.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
[BUGFIX] Incorrect HTTP range specification in Linkvalidator
Range specifications in HTTP may not include spaces. While many
web servers tolerate them, some return a 416 HTTP error. This
change makes range request from Linkvalidator to follow RFC 7233.
Resolves: #88958
Releases: master, 9.5, 8.7
Change-Id: I06fe31ab9db1a0391853f21ce28cb92be0b5656d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61468
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
[BUGFIX] Incorrect HTTP range specification in Linkvalidator
Range specifications in HTTP may not include spaces. While many
web servers tolerate them, some return a 416 HTTP error. This
change makes range request from Linkvalidator to follow RFC 7233.
Resolves: #88958
Releases: master, 9.5, 8.7
Change-Id: I06fe31ab9db1a0391853f21ce28cb92be0b5656d
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/61469
Tested-by: TYPO3com <noreply@typo3.com>
Tested-by: Andreas Fernandez <a.fernandez@scripting-base.de>
Reviewed-by: Andreas Fernandez <a.fernandez@scripting-base.de>
History
#1
Updated by Dmitry Dulepov 4 months ago
By the way, there is no need to fetch 4K of bytes. 512 or even 256 bytes will be enough.
#2
Updated by Gerrit Code Review 4 months ago
- Status changed from New to Under Review
Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61496
#3
Updated by Dmitry Dulepov 4 months ago
The fix is contributed by the University of Basel.
#4
Updated by Gerrit Code Review 4 months ago
Patch set 1 for branch 9.5 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61468
#5
Updated by Gerrit Code Review 4 months ago
Patch set 1 for branch TYPO3_8-7 of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/61469
#6
Updated by Dmitry Dulepov 4 months ago
- Status changed from Under Review to Resolved
- % Done changed from 0 to 100
Applied in changeset ef3912ad3c0c4d011874cb591b1b7a3a0bcfe67d.