Skip to content

Incorrect canonical url on /tags and /all in when using kubernetes (depending on which route is not default) #2673

@imorland

Description

@imorland

Bug Report

Current Behavior
A clear and concise description of the behavior.

Steps to Reproduce

  1. Go to https://community.giffgaff.com
  2. View source
  3. Notice the canonical url is set correctly
  4. Go to https://community.giffgaff.com/all
  5. View source
  6. Notice the canonical url has picked up the internal kubernetes hostname

Expected Behavior
The correct url is present in the canonical parameter

Environment

Possible Solution
The issue lies in two files:
https://github.com/flarum/core/blob/ba9665e9db0723af79aa5f381ecabb85b2b1ebcd/src/Forum/Content/Index.php#L88
https://github.com/flarum/tags/blob/f85cc591021f32627be32f0be9f49c3a0b0eb71f/src/Content/Tags.php#L97

Instead of retrieving the hostname from the request $request->getUri()->withQuery(''), something like $this->url->to('forum')->base() . $request->getUri()->getPath()

PR incoming shortly!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions