Bug #54187

Router ignores default Suffix from browser

Added by Thomas Hempel over 1 year ago. Updated over 1 year ago.

Status:Resolved Start date:2013-12-04
Priority:Should have Due date:
Assigned To:Bastian Waidelich % Done:

100%

Category:-
Target version:-

Description

Since Neos beta 2 one has to set the defaultUriSuffix. If you set it to .html all links will be created like "page1.html", "page2.html" etc. So far so good.

But if you enter an address like "page1.jgsdhjgasjdhg" or "page2.FooBarBaz" in your browser, the page is still displayed despite the wrong suffix. You can just enter anything. Only the name is processed. This behavior is rather unexpected. An unknown suffix should at least return a 404 status.

Best wishes,
Thomas

P.S.: Sorry if this is in the wrong project. Not sure where to put. It seems like a routing problem and not Neos specific.


Related issues

related to TYPO3.Neos - Bug #54217: Using "(/)" as defaultUriSuffix only works for top-level ... Closed 2013-12-05

Associated revisions

Revision eaaa9aef
Added by Bastian Waidelich over 1 year ago

[!!!][BUGFIX] Only accepts URLs with the configured URI suffix

This change removes two obsolete routes and adjusts the
``FrontendNodeRoutePartHandler`` so that it matches the full node path.

Background:
The route "Content with some format" accepted all URLs in the format
``{node}.{@format}`` which lead to duplicate content (if your default
suffix is empty and the user appends ".html") and weird errors (if an
arbitrary extension is added to the path, like "some/path.anything").

Besides this change simplifies the ``FrontendNodeRoutePartHandler`` so
that it does not ignore the ``splitString`` option if no dot could be
found in the request path.

This is a breaking change if you relied on the fact that any format
suffix is accepted by Neos.
If you provide a custom format (for example "ics") you should register
a custom route for it in your package::

-
name: 'ICS'
uriPattern: '{node}.ics'
defaults:
'@package': 'TYPO3.Neos'
'@controller': 'Frontend\Node'
'@action': 'show'
'@format': 'ics'
routeParts:
'node':
handler: 'TYPO3\Neos\Routing\FrontendNodeRoutePartHandler'

Releases: master, 1.0
Change-Id: Iea1b92b07daba69f5f76cd7ceb7b81f2d14d68a1
Fixes: #54187
Related: #54217
Related: #55492
Reviewed-on: https://review.typo3.org/25980
Tested-by: Bastian Waidelich
Reviewed-by: Dominique Feyer
Tested-by: Dominique Feyer
Reviewed-by: Aske Ertmann
Reviewed-by: Bastian Waidelich

Revision 7a07bcb1
Added by Bastian Waidelich over 1 year ago

[BUGFIX] Prevent exception when matching incoming context URIs

This fixes a regression that was introduced with a previous commit
which resulted in an exception when logging into the backend.

Background:
A previous commit (Iea1b92b07daba69f5f76cd7ceb7b81f2d14d68a1)
streamlined the mapping of request paths to a node.
Unfortunately this introduced a regression that resulted in an
exception being thrown whenever a context URI (containing the
"@workspace" part) was matched by the homepage route.

This change fixes this by testing whether the given context path
could be matched.

Change-Id: Icd3be53d5d8abd44701ccacfbdd471090b88450c
Related: #54187
Releases: master
Reviewed-on: https://review.typo3.org/27688
Tested-by: Bastian Waidelich
Reviewed-by: Marc Neuhaus
Tested-by: Marc Neuhaus
Reviewed-by: Bastian Waidelich

Revision 437ec25a
Added by Bastian Waidelich over 1 year ago

[!!!][BUGFIX] Only accepts URLs with the configured URI suffix

This change removes two obsolete routes and adjusts the
``FrontendNodeRoutePartHandler`` so that it matches the full node path.

Background:
The route "Content with some format" accepted all URLs in the format
``{node}.{@format}`` which lead to duplicate content (if your default
suffix is empty and the user appends ".html") and weird errors (if an
arbitrary extension is added to the path, like "some/path.anything").

Besides this change simplifies the ``FrontendNodeRoutePartHandler`` so
that it does not ignore the ``splitString`` option if no dot could be
found in the request path.

This is a breaking change if you relied on the fact that any format
suffix is accepted by Neos.
If you provide a custom format (for example "ics") you should register
a custom route for it in your package::

-
name: 'ICS'
uriPattern: '{node}.ics'
defaults:
'@package': 'TYPO3.Neos'
'@controller': 'Frontend\Node'
'@action': 'show'
'@format': 'ics'
routeParts:
'node':
handler: 'TYPO3\Neos\Routing\FrontendNodeRoutePartHandler'

Releases: master, 1.0
Change-Id: Iea1b92b07daba69f5f76cd7ceb7b81f2d14d68a1
Fixes: #54187
Related: #54217
Related: #55492
Reviewed-on: https://review.typo3.org/27656
Reviewed-by: Bastian Waidelich
Tested-by: Bastian Waidelich
Reviewed-by: Aske Ertmann

History

#1 Updated by Bastian Waidelich over 1 year ago

  • Project changed from TYPO3.Flow to TYPO3.Neos
  • Status changed from New to Accepted
  • Assigned To set to Bastian Waidelich

#2 Updated by Bastian Waidelich over 1 year ago

The reason for this behavior is this route:

1-
2  name: 'Content with some format'
3  uriPattern: '{node}.{@format}'
4  appendExceedingArguments: true

in Routes.Frontend.yaml.

Needs to be discussed

#3 Updated by Jan Kiesewetter over 1 year ago

To fix this manually I loaded the
Routes.yaml from git
https://git.typo3.org/Neos/Distributions/Base.git/blob_plain/224ea64520e1f54c3e9a30e79c163e9220ee8e67:/Configuration/Routes.yaml
and put it in neos/Configuration/Routes.yaml

#4 Updated by Bastian Waidelich over 1 year ago

Jan Kiesewetter wrote:

To fix this manually I loaded the
Routes.yaml from git [...]

Jan, thanks for the feedback, but this is a different issue.

#5 Updated by Andreas Wolf over 1 year ago

To me, this looks like it is related to #54217.

#6 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Accepted to Under Review

Patch set 1 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25980

#7 Updated by Gerrit Code Review over 1 year ago

Patch set 2 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25980

#8 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25980

#9 Updated by Gerrit Code Review over 1 year ago

Patch set 4 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25980

#10 Updated by Gerrit Code Review over 1 year ago

Patch set 5 for branch master of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/25980

#11 Updated by Gerrit Code Review over 1 year ago

Patch set 1 for branch 1.0 of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/27656

#12 Updated by Bastian Waidelich over 1 year ago

  • Status changed from Under Review to Resolved
  • % Done changed from 0 to 100

#13 Updated by Gerrit Code Review over 1 year ago

  • Status changed from Resolved to Under Review

Patch set 2 for branch 1.0 of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/27656

#14 Updated by Gerrit Code Review over 1 year ago

Patch set 3 for branch 1.0 of project Packages/TYPO3.Neos has been pushed to the review server.
It is available at https://review.typo3.org/27656

#15 Updated by Bastian Waidelich over 1 year ago

  • Status changed from Under Review to Resolved

Also available in: Atom PDF