Skip to content

redirects incorrectly computed on Windows #313

Closed
@jeffmcaffer

Description

@jeffmcaffer

Redirect computation fails in some cases on Windows.

What is the current behavior?

npm test results the following error. i've not tracked it down yet but inevitably it will be a path.join problem

 FAIL  tests/routing/deprecated-enterprise-versions.js (71.257 s)
  ● enterprise deprecation › workaround for lost frontmatter redirects works in deprecated enterprise content >=2.13

    expect(received).toBe(expected) // Object.is equality

    Expected: "/en/enterprise/2.15/user/articles/viewing-contributions-on-your-profile"
    Received: "%5Cen%5Centerprise%5C2.15%5Cuser%5Carticles%5Cviewing-contributions-on-your-profile"

      28 |     const res = await get('/en/enterprise/2.15/user/articles/viewing-contributions-on-your-profile-page')
      29 |     expect(res.statusCode).toBe(301)
    > 30 |     expect(res.headers.location).toBe('/en/enterprise/2.15/user/articles/viewing-contributions-on-your-profile')
         |                                  ^
      31 |   })
      32 |
      33 |   test('handles requests for deprecated Enterprise pages ( >=2.13 )', async () => {

      at Object.<anonymous> (tests/routing/deprecated-enterprise-versions.js:30:34)

What changes are you suggesting?

likely should just wrap the join call with a call to slash

cc: @github/docs-engineering , @chiedo

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugAn error or flaw that causes unintended or unexpected resultsengineeringWill involve Docs Engineering

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions