YoniKF commented on code in PR #637:
URL: https://github.com/apache/pekko-http/pull/637#discussion_r1882235247


##########
http-core/src/main/scala/org/apache/pekko/http/scaladsl/model/Uri.scala:
##########
@@ -129,7 +129,8 @@ sealed abstract case class Uri(scheme: String, authority: 
Authority, path: Path,
   /**
    * Returns a copy of this Uri with the given query.
    */
-  def withQuery(query: Query): Uri = copy(rawQueryString = if (query.isEmpty) 
None else Some(query.toString))
+  def withQuery(query: Query): Uri =
+    createUnsafe(scheme, authority, path, if (query.isEmpty) None else 
Some(query.toString), fragment)

Review Comment:
   Consider adding a `copyUnsafe` method and calling it here and also in all 
the other `with...` methods (this assumes that the query stored inside `Uri` is 
also already encoded).



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to