Bug #88958

Linkvalidator: incorrect range specification

Added by Dmitry Dulepov 4 months ago. Updated 4 months ago.

Status:
Resolved
Priority:
Should have
Assignee:
-
Category:
Linkvalidator
Target version:
-
Start date:
2019-08-14
Due date:
% Done:

100%

TYPO3 Version:
8
PHP Version:
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

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

Revision ef3912ad (diff)
Added by Dmitry Dulepov 4 months ago

[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 <>
Tested-by: Georg Ringer <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Georg Ringer <>
Reviewed-by: Oliver Klee <>
Reviewed-by: Andreas Fernandez <>

Revision 7a43756b (diff)
Added by Dmitry Dulepov 4 months ago

[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 <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

Revision d5243e0d (diff)
Added by Dmitry Dulepov 4 months ago

[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 <>
Tested-by: Andreas Fernandez <>
Reviewed-by: Andreas Fernandez <>

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

Also available in: Atom PDF