-
Notifications
You must be signed in to change notification settings - Fork 67
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
finagle (fix): Properly set http method and path parameters in convertToFinagleRequest #3179
Conversation
Codecov Report
Additional details and impacted files@@ Coverage Diff @@
## main #3179 +/- ##
==========================================
+ Coverage 82.88% 82.89% +0.01%
==========================================
Files 350 350
Lines 14743 14745 +2
Branches 2447 2401 -46
==========================================
+ Hits 12219 12223 +4
+ Misses 2524 2522 -2
... and 2 files with indirect coverage changes Continue to review full report in Codecov by Sentry.
|
bac9203
to
23f300e
Compare
val response = convertToFinagleRequest(req) | ||
|
||
response.method.name shouldBe "GET" | ||
response.path shouldBe "/foo" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I thought the path can contain the query string ?bar=true&baz=1234
. Does it need to be set as params?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does it need to be set as params?
IIRC, there is a way to set a path with query parameters. If the way to get a path with a query string exists, I would use a simpler way.
Considering the duplication of parameters, value encoding issues and etc, I adopted the above way.
In my understanding, path doesn't contain a query string.
And, according to the wikipedia, behavior of the uri
parameter in the case class, Request
, is different with the definition of URI in the wikipedia.
I was actually confused with it before.
airframe/airframe-http/src/main/scala/wvlet/airframe/http/HttpMessage.scala
Lines 207 to 214 in 8ef23a3
case class Request( | |
method: String = HttpMethod.GET, | |
// Path and query string beginning from "/" | |
uri: String = "/", | |
header: HttpMultiMap = HttpMultiMap.empty, | |
message: Message = EmptyMessage, | |
remoteAddress: Option[ServerAddress] = None | |
) extends HttpMessage[Request] { |
Overview
convertToFinagleRequest
doesn't respectMethod
,request path
and etc