Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

dadjeibaah
Copy link
Contributor

When using the io.l5d.path identifier this these config values

kind: io.l5d.path
segments: 1
consume: true

and a request url like GET /mysvc?param=1&param=2 Linkerd would drop the query parameters when sending the request for dtab delegation.

This PR makes sure that query parameters are added to the dtab request url if the query parameters are available. This was tested with a local instance of Linkerd talking to a simple service that accepted requests with params.

fixes #1725

@dadjeibaah dadjeibaah self-assigned this Dec 6, 2017
@dadjeibaah dadjeibaah force-pushed the deebo91/pathidentifier-params branch from 016a8a3 to 8b5fed5 Compare December 7, 2017 00:05
@dadjeibaah dadjeibaah force-pushed the deebo91/pathidentifier-params branch from 108d50c to f7eee3c Compare December 7, 2017 00:11
Copy link
Member

@adleong adleong left a comment

Choose a reason for hiding this comment

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

Mostly looks good. Thanks for adding new tests that capture this.

def apply(req: Request): Future[RequestIdentification[Request]] =
req.path.split("/").drop(1) match {
case path if path.size >= segments =>
val params = req.getParams()
Copy link
Member

Choose a reason for hiding this comment

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

rather than getting and re-encoding the query string, I would just do something like:

val query = {
  val u = req.uri
  u.indexOf('?') match {
    case -1 => ""
    case n => u.substring(n)
  }
}

Copy link
Member

@adleong adleong left a comment

Choose a reason for hiding this comment

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

⭐ 🏡 ❓ 🗡

@dadjeibaah dadjeibaah merged commit 217feb6 into master Dec 8, 2017
@dadjeibaah dadjeibaah deleted the deebo91/pathidentifier-params branch December 8, 2017 01:06
@hawkw hawkw mentioned this pull request Dec 15, 2017
hawkw added a commit that referenced this pull request Dec 15, 2017
## 1.3.4 2017-12-15

Linkerd 1.3.4 continues the focus on reliability and stability. It includes a bugfix for HTTP/2 and gRPC routers, several improvements to the Consul namer and dtab store, fixes for 4xx responses in the Kubernetes namer, and more.

* Fix an issue where the `io.l5d.path` identifier would consume query parameters from the request URL, preventing them from reaching the downstream service ([#1734](#1734)).
* Several minor fixes to documentation and examples.
* Consul
  * Improve handling of invalid namespaces in Namerd's Consul dtab store ([#1739](#1739)).
  * Add backoffs to Consul dtab store observation retries ([#1742](#1742)).
  * Fix `io.l5d.consul` namer logging large numbers of spurious error messages during normal operation ([#1738](#1738)).
* HTTP/2 and gRPC
  * Fix buffer data corruption regression introduced in 1.3.3 ([#1751](#1751)). Thanks to [@vadimi](https://github.com/vadimi), who contributed to this fix!
* Kubernetes
  * Improve handling of Kubernetes API watch errors in `io.l5d.k8s` ([#1744](#1744), [#1752](#1752)).
* Namerd
  * Fix `NoHostsAvailable` exception thrown by `io.l5d.mesh` when Namerd has namers configured with transformers ([#1729](#1729)).

Signed-off-by: Eliza Weisman <[email protected]>
Tim-Brooks pushed a commit to Tim-Brooks/linkerd that referenced this pull request Dec 20, 2018
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.

PathIdentifier consumes a segment of the path with query parameters
2 participants