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

fix(plugins/plugin-bash-like): fix url regex #4501

Merged
merged 1 commit into from
May 8, 2020

Conversation

hanqiuzh
Copy link
Contributor

@hanqiuzh hanqiuzh commented May 8, 2020

current regex :(\d+)? will fail to parse urls without port (e.g. http://kui.io/...)

also, the way of generating url may have problem. if current href is https://kui.io/kui?query..., after replace, the ending part will still be there, so url will be https://kui.io/kui?query.../bash/... instead of https://kui.io/bash/....

if server returns a path start from /, shouldn't it to be directly append after host?

Description of what you did:

Fix bash-like client url regex

My PR is a:

  • 💥 Breaking change
  • 🐛 Bug fix
  • 💅 Enhancement
  • 🚀 New feature

Please confirm that your PR fulfills these requirements

  • Multiple commits are squashed into one commit.
  • The commit message follows Conventional Commits, which allows us to autogenerate release notes; e.g. fix(plugins/plugin-k8s): fixed annoying bugs
  • All npm dependencies are pinned.

current regex `:(\d+)?` will fail to parse urls without port (e.g. http://kui.io/...) 

also, the way of generating url may have problem. if current href is `https://kui.io/kui?query...`, after replace, the ending part will still be there, so url will be `https://kui.io/kui?query.../bash/...` instead of `https://kui.io/bash/...`. 

if server returns a path start from `/`, shouldn't it to be directly append after host?
@hanqiuzh hanqiuzh requested a review from starpit as a code owner May 8, 2020 01:23
@codecov
Copy link

codecov bot commented May 8, 2020

Codecov Report

Merging #4501 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #4501   +/-   ##
=======================================
  Coverage   59.04%   59.04%           
=======================================
  Files          75       75           
  Lines        2410     2410           
  Branches      582      582           
=======================================
  Hits         1423     1423           
  Misses        762      762           
  Partials      225      225           

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 3f7a32f...3b5636a. Read the comment docs.

Copy link
Contributor

@starpit starpit left a comment

Choose a reason for hiding this comment

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

nice catch. lgtm, thanks!

@starpit starpit merged commit a97b249 into kubernetes-sigs:master May 8, 2020
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.

2 participants