Skip to content

Middleware: Pass non-branch query parameters on redirect / take 2#85

Closed
sirreal wants to merge 1 commit intomasterfrom
revert-84-revert-81-update/pass-query-params
Closed

Middleware: Pass non-branch query parameters on redirect / take 2#85
sirreal wants to merge 1 commit intomasterfrom
revert-84-revert-81-update/pass-query-params

Conversation

@sirreal
Copy link
Copy Markdown
Member

@sirreal sirreal commented Jan 12, 2019

#81 second attempt after revert in #84
cc: @dmsnell

Comment thread src/middlewares.ts

const query =
Object.keys( req.query )
.reduce(
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

i think the querystring module will do this for you

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

https://nodejs.org/api/querystring.html#querystring_querystring_stringify_obj_sep_eq_options

i think you're removing the branch key and then serializing the remaining query?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

i think you're removing the branch key and then serializing the remaining query?

That was the intention, but it didn't work as expected. See the resulting redirections from #84:

  • /?branch=master -> /?
  • /?branch=master&flags=jetpack/checklist -> /?flags=undefined

@sirreal sirreal closed this Apr 11, 2023
@sirreal sirreal deleted the revert-84-revert-81-update/pass-query-params branch April 11, 2023 13:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants