Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add trailing slash to dashboard #5811

Open
wants to merge 1 commit into
base: main-3
Choose a base branch
from

Conversation

jvalkeal
Copy link
Collaborator

  • Boot 3.x changed handling of trailing slash meaning it's now adviced to define both /dashboard and /dashboard/ in UiController

Essentially to fix latter:

jvalkealahti@cypher:/tmp/xxx$ http --headers http://localhost:9393/dashboard
HTTP/1.1 302 
Connection: keep-alive
Content-Language: en-GB
Content-Length: 0
Date: Mon, 13 May 2024 12:36:17 GMT
Keep-Alive: timeout=60
Location: http://localhost:9393/dashboard/index.html

jvalkealahti@cypher:/tmp/xxx$ http --headers http://localhost:9393/dashboard/
HTTP/1.1 500 
Connection: close
Content-Type: application/hal+json
Date: Mon, 13 May 2024 12:36:21 GMT
Transfer-Encoding: chunked
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers

- Boot 3.x changed handling of trailing slash meaning
  it's now adviced to define both /dashboard and
  /dashboard/ in UiController
Copy link
Contributor

@corneil corneil left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@@ -27,7 +27,7 @@
* @author Gunnar Hillert
*/
@Controller
@RequestMapping(UiController.WEB_UI_INDEX_PAGE_ROUTE)
@RequestMapping({ UiController.WEB_UI_INDEX_PAGE_ROUTE, UiController.WEB_UI_INDEX_PAGE_ROUTE + "/" })
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because this approach only fixes this controller, until we adjust globally (recommended by the release notes) I would rather set the default as it was before using something like:

@Configuration
public class WebConfiguration implements WebMvcConfigurer {

    @Override
    public void configurePathMatch(PathMatchConfigurer configurer) {
      configurer.setUseTrailingSlashMatch(true);
    }
  
}

Wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onobc sorry I missed your question. I'd rather not to set it globally because setUseTrailingSlashMatch is already deprecated. We anyway need to handle this in a recommended way going forward.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@onobc sorry I missed your question

No worries @jvalkeal.

I'd rather not to set it globally because setUseTrailingSlashMatch is already deprecated. We anyway need to handle this in a recommended way going forward.

If we don't fix it globally then maybe we should not fix the dashboard either. Since this is a major update we can just list this as a breaking change.

Copy link
Contributor

@onobc onobc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @jvalkeal - please see my comment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants