Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • 02:09
    mergify[bot] labeled #6843
  • 02:09
    mergify[bot] labeled #6843
  • 02:09
    armanbilge opened #6843
  • 01:39
    http4s-steward[bot] synchronize #6820
  • 01:39

    http4s-steward[bot] on series

    Deprecate Query#apply Update sbt-http4s-org to 0.14.9… Merge pull request #6823 from h… and 27 more (compare)

  • 00:20
    janilcgarcia commented #6840
  • Dec 02 21:41

    github-actions[bot] on gh-pages

    deploy: 355aaefcf2593d9cdd54091… (compare)

  • Dec 02 21:36

    armanbilge on series

    (compare)

  • Dec 02 21:35

    armanbilge on 0.23

    Update epollcat to 0.1.3 in ser… Merge pull request #6841 from h… (compare)

  • Dec 02 21:35
    armanbilge closed #6841
  • Dec 02 20:23
    mergify[bot] labeled #6841
  • Dec 02 20:23
    mergify[bot] labeled #6841
  • Dec 02 20:23
    http4s-steward[bot] opened #6841
  • Dec 02 20:22

    http4s-steward[bot] on series

    Update epollcat to 0.1.3 in ser… (compare)

  • Dec 02 16:36
    armanbilge labeled #6840
  • Dec 02 16:36
    armanbilge labeled #6840
  • Dec 02 16:35
    armanbilge commented #6840
  • Dec 02 14:40
    janilcgarcia opened #6840
  • Dec 02 09:19
    danicheg synchronize #6830
  • Dec 01 20:38
    danicheg commented #776
Olav Grøndal
@ogroendal
The curl call succeeds - but the request using the header definition above fails with a 401
When I add the -v parameter to curl I see it makes a header like "Authorization: Basic <key>"
What is the difference from the above header definition in http4s?
Olav Grøndal
@ogroendal
To answer my own question : Authorization(BasicCredentials(b2keyId, b2key)) is the thing that matches the curl call
Alexey Rykhalskiy
@alexr007
Hi, Folks!
I'm trying to use ScalaJS with http4s-ember-client
The part, dependent on cats/cats-effects/fs2 works well,
but ember client (seems has some JS dependencies) requires precise configuration.
I fugured out all dependencies (buffer, crypto, net, os, punycode, stream, tls)
there is no fatal compilation errors, a lot of warnings. and it doesn't work :(
Does anybody have working configuration for any http client with scalajs ?
Here is my project git@github.com:alexr007/sjs-questions.git
Velichko Anton
@tonyvelichko

Hi, everyone,

I'm trying to download an octet-stream response from the remote server with the http4s blaze client, and constantly receiving the org.http4s.InvalidBodyException: Received premature EOF, while the same request with curl run without any issues. The error looks like http4s/http4s#4404, but reproduces all the time. Maybe someone knows the workaround for that?

I've also tried the okhttp client and it's responding differently compared to blaze but still unsuccessfully.
java.io.IOException: closed
  at okio.RealBufferedSource$inputStream$1.read(RealBufferedSource.kt:154)
  at java.base/java.io.InputStream.read(InputStream.java:218)
Kai Matsuda
@vangogh500

Hi, everyone,
I'm using the EmberClientBuilder.default when creating my http4s client. When I hit my https endpoint it seems to be having issues with the underlying certificate manager?

j.l.NullPointerException: null\n\tat s.n.u.IPAddressUtil.textToNumericFormatV4(IPAddressUtil.java:49)\n\tat s.n.u.IPAddressUtil.isIPv4LiteralAddress(IPAddressUtil.java:241)\n\tat s.s.u.HostnameChecker.isIpAddress(HostnameChecker.java:125)\n\tat s.s.u.HostnameChecker.match(HostnameChecker.java:93)\n\tat s.s.s.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:455)\n\tat s.s.s.X509TrustManagerImpl.checkIdentity(X509TrustManagerImpl.java:436)\n\tat s.s.s.X509TrustManagerImpl.checkTrusted(X509TrustManagerImpl.java:252)\n\tat s.s.s.X509TrustManagerImpl.checkServerTrusted(X509TrustManagerImpl.java:136)\n\tat s.s.s.ClientHandshaker.serverCertificate(ClientHandshaker.java:1626)\n\tat s.s.s.ClientHandshaker.processMessage(ClientHandshaker.java:223)\n\tat s.s.ssl.Handshaker.processLoop(Handshaker.java:1037)\n\tat s.s.ssl.Handshaker$1.run(Handshaker.java:970)\n\tat s.s.ssl.Handshaker$1.run(Handshaker.java:967)\n\tat j.s.AccessController.doPrivileged(AccessController.java)\n\tat s.s.s.Handshaker$DelegatedTask.run(Handshaker.java:1459)\n\tat f.i.n.t.SSLEngineTaskRunner$$anon$1.$anonfun$runDelegatedTasks$1(SSLEngineTaskRunner.scala:44)\n\tat s.r.j.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.scala:18)\n\tat c.e.u.WorkerThread.blockOn(WorkerThread.scala:591)\n\tat s.c.package$.blocking(package.scala:124)\n\tat cats.effect.IOFiber.runLoop(IOFiber.scala:967)\n\tat cats.effect.IOFiber.asyncContinueSuccessfulR(IOFiber.scala:1338)\n\tat cats.effect.IOFiber.run(IOFiber.scala:140)\n\tat c.e.u.WorkerThread.run(WorkerThread.scala:523)\nWrapped by: j.l.RuntimeException: Delegated task threw Exception/Error\n\tat s.s.ssl.Handshaker.checkThrown(Handshaker.java:1519)\n\tat s.s.s.SSLEngineImpl.checkTaskThrown(SSLEngineImpl.java:528)\n\tat s.s.s.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:802)\n\tat s.s.s.SSLEngineImpl.unwrap(SSLEngineImpl.java:766)\n\tat j.net.ssl.SSLEngine.unwrap(SSLEngine.java:624)\n\tat f.i.n.t.TLSEngine$$anon$1.$anonfun$unwrapHandshake$1(TLSEngine.scala:250)\n\tat f.i.n.t.InputOutputBuffer$$anon$1.$anonfun$perform$3(InputOutputBuffer.scala:92)\n\tat d.i.n.t.InputOutput...\n

Seems related to this issue in jdk ssl engine?
reactor/reactor-netty#473

Kai Matsuda
@vangogh500
^ Upgrading from JDK 8 => 11 fixed the above issue. As mentioned I'm guessing it's a bug with the specific implementation of the JDK 8 version of SSLEngine
Selin Gungor
@SelinGungor
Hello all, I need to parse the input parameter as CSV format in http4s. Is there something like CsvSeq from akka?
Vitalii
@Kihkhh_gitlab
Hi all
image.png

I am trying to convert the case class to multipart form and send a post request to the server , For example: see screenshot

as response I have : {"details":"Unexpected number in JSON at position 1","correlationId":"7ee50","message":"Bad Request"}

what I did worng? Could anyone help me?

sc6l6d3v
@sc6l6d3v

Hi folks, currently on http4s 0.23.12, scala 2.13.6 to use cats effect 3.3.11 but seem to be stuck on an entityDecoder from http4s-circe which has

`import org.http4s.circe.
import org.http4s.{EntityDecoder, EntityEncoder,
}

trait GeoIP[F[_]] extends Cache[F] {
def getByIP(state: String): F[GeoIP.IP]
}

object GeoIP {
def applyF[_]: GeoIP[F] = ev

final case class IP(ip: String = "", country_code2: String = "", country_code3: String = "", country_name: String = "",
state_prov: String = "", district: String = "", city: String = "", zipcode: String = "",
latitude: String = "", longitude: String = "", organization: String = "") {
override def toString: String = s"$this"
}

object IP {
implicit val ipDecoder: Decoder[IP] = deriveDecoder[IP]
implicit def stateEntityDecoder[F[]]: EntityDecoder[F, IP] = jsonOf[F, IP]
implicit val stateEncoder: Encoder[IP] = deriveEncoder[IP]
implicit def stateEntityEncoder[F[
]]: EntityEncoder[F, IP] = jsonEncoderOf
}`

where it throws this compilation error:

[error] /home/hkatz/Workspace/geoipService/src/main/scala/com/iscs/geoip/domains/GeoIP.scala:36:73: could not find implicit value for evidence parameter of type cats.effect.Concurrent[F] (Could not find an instance of Monad for F)
[error] implicit def stateEntityDecoder[F[_]]: EntityDecoder[F, IP] = jsonOf[F, IP]
[error]

Unclear how the suggestions in the [migration guide] (https://typelevel.org/cats-effect/docs/migration-guide#concurrent) apply to this use case.

Suggestions welcome.

Ali Shah
@Alee02
Hey guys, Im wondering if its possible to inspect the request after its been manipulated by Client middleware?
morozov11
@morozov11

here is what I found in WebSocketBuilder2 code:

private def buildResponse(webSocket: WebSocket[F]): F[Response[F]] =
onNonWebSocketRequest
.map(
_.withAttribute(
webSocketKey,
WebSocketContext(
webSocket,
headers,
onHandshakeFailure,
),
)
)
Wherein

onNonWebSocketRequest =
ResponseF.withEntity("This is a WebSocket route.").pure[F],
It turns out that the builder itself immediately gives an error 501 to client.

What iam doing wrong?
Dylan Halperin
@dylemma
When I'm receiving a Request[F], it seems like the URI's scheme and authority are always empty. How can I get that first part of the URL e.g. http://localhost:8080 or https://localhost from the request URI?
summertime0111
@summertime0111:matrix.org
[m]
Hi I'm trying to make a proxy server using the Ember client. I've tatken the help from this: https://stackoverflow.com/questions/48474474/how-to-use-http4s-server-and-client-library-as-a-proxy, the code seems to complie and run but the proxy server stops the requests at like 23 requests. does anyone know why?
Ross A. Baker
@ross:rossabaker.com
[m]
Sorry, the developers voted to move off Gitter. I recommend a GitHub issue, or many of the other developers can be reached at the Discord link in the topic. Thanks.
Lakin Wecker
@lakinwecker
I'm trying to follow https://http4s.org/v0.23/docs/streaming.html but with scala3 and I'm running into various issues that I feel like should be easy to solve, but are escaping me right now. Is there a better example (preferably using scala3) that I should use? Or should I not use scala3 right now?
Lakin Wecker
@lakinwecker
Doesn't help that javadoc.io seems down right now. :(
I managed to make it work! Thanks for listening. :D
blast_hardcheese
@blast_hardcheese:matrix.org
[m]
Is blaze being independently versioned from the rest of http4s, or has it been and the versions just happened to align up until now?
Kenneth Monteiro
@ManiacViper
does the ember client metrics middleware consider timeouts as errors? im asking as I dont see any error metrics for timeouts although in the logs i do see the timeout messages, assume we can test this via an integration test with a stub maybe
Jonas Jaszkowic
@Jaszkowic

Hi, I want to get rid of the "Accepted connection" logs in http4s (version 0.21.22):

{"@timestamp":"2022-07-15T09:54:20.939+02:00","@version":"1","message":"Accepted connection from /127.0.0.1:50889","logger_name":"org.http4s.blaze.channel.nio1.NIO1SocketServerGroup","thread_name":"blaze-selector-0","level":"INFO","level_value":20000}

I can't find any configuration for log levels or disabling this. Any hints?

Jonas Jaszkowic
@Jaszkowic

Ok, I can simply disable it in logback.xml:

<logger name="org.http4s.blaze.channel.nio1.NIO1SocketServerGroup" level="ERROR"/>

Pavels Sisojevs
@psisoyev
Hi, I’m migrating my Http4s websocket application from 1.0.0-M23 to 1.0.0-M34.
Now, as I shouldn’t create a WebSocketBuilder myself but it is passed from the server, how can I unit test my routes if they require passing a WebSocketBuilder, which I can’t create myself?
falconhash
@falconhash:matrix.org
[m]
Never depend on a single income to get financial freedom. I can teach you how you can earn from $5,000 to $6,000 weekly,without sending money to me or anyone, but you will pay me 10% commission when you receive your profit. if you are interested, ask me how via Whatsapp
👇👇👇
+1 (570) 801-0862
Never depend on a single income to get financial freedom. I can teach you how you can earn from $5,000 to $6,000 weekly,without sending money to me or anyone, but you will pay me 10% commission when you receive your profit. if you are interested, ask me how via Whatsapp
👇👇👇
+1 (570) 801-0862
Never depend on a single income to get financial freedom. I can teach you how you can earn from $5,000 to $6,000 weekly,without sending money to me or anyone, but you will pay me 10% commission when you receive your profit. if you are interested, ask me how via Whatsapp
👇👇👇
+1 (570) 801-0862
Jens Grassel
@jan0sch

Hi, I'm having trouble with mixing path parameters and capturing the rest of the path:

case authedRequest @ GET -> Root / MyParamA(myA) / MyParamB(b) /: restOfThePath as user => ???

I get the following compiler error (using http4s 1.0.0-M35 and Scala 3.1.3):

/ (which is left-associative) and /: (which is right-associative) have same precedence and may not be mixed

Any ideas how this could be tackled? I would like to avoid something like GET -> Root /: rest and then fiddle everything out in custom code resulting in hand crafted redirects and so on.

blast_hardcheese
@blast_hardcheese:matrix.org
[m]
@jan0sch: parenthesize before /: ?
Jens Grassel
@jan0sch
Thanks, it is solved (you cannot mix the directives) so there is also a pr for the documentation: http4s/http4s#6598
Jose Vicente Ayala Luna
@vin001gmailcom
Hi, currently I'm working on a project using Http4s version 0.22.14 and http4s-blaze-server. Part of the requirements is to report APM (Application Performance Monitoring) metrics into DataDog, but it does not work with http4s-blaze-server. According to this https://github.com/DataDog/dd-trace-java/issues/1934#issuecomment-1049866072, it seems the alternative is to use http4s-netty (version 0.4.0). Could you please confirm that or do you know an alternative to create APM metrics into DataDog using Http4s?
fromscalatohaskell
@fromscalatohaskell_gitlab
how can I match following route?
 "api" / "v1" / "foobar" /: remainder
this doesnt work due to left- and right-associative operators with same precedence may not be
SethLasky
@SethLasky
Hey all - I want to send a post request with no body using the blaze client but its giving the error: org.http4s.MalformedMessageBodyFailure: Malformed message body: Invalid JSON: empty body - is there any way around this?
tagr
@tagr:matrix.org
[m]

What do people use or recommend for encryption and decryption?

Context: I was following this page: https://http4s.org/v0.23/docs/auth.html Cryptobits seems neat, but very limited functionality (only a few lines of code, which is nice). TSec appears powerful, well-built, and scala-3 support but their GitHub page shows it's "archived," which has me questioning it's long-term support.

Ross A. Baker
@ross:rossabaker.com
[m]
tagr: Sorry, this channel is deprecated. I can help on discussions on the GitHub repo, or others are available at the Discord linked in the topic.
ferguson valenzuela
@fergusonvalenz3_twitter
Hello everyone. In http4s, I need to parse the input parameter as CSV. Is there something similar to Akka's CsvSeq? Game geometry dash is a game that is loved by many people.
ldeck
@ldeck
Hey all — newbie http4s and cats type question. If I have a function def fooBar[A](items: Seq[A]): IO[Response[IO] = Ok(items.mkString("[", ",", "]") how would I make the effect type abstract and still have it compile? e.g., I've tried def fooBar[F[_] , A](items: Seq[A]): F[Response[F]] = Ok(...)
Ross A. Baker
@ross:rossabaker.com
[m]
@ldeck: Sorry, this channel is deprecated. I still help via GitHub issues, or others are at the Discord link in the topic.
ldeck
@ldeck
Oops, thanks @ross:rossabaker.com -- didn't see the link in the header :-D
Ross A. Baker
@ross:rossabaker.com
[m]
Sorry for the redirect. If I had my way, we'd still be here. 😄
Son
@sonhmai
hi all. I’m creating a http4s.Client with timeouts in the example code below. How to I add logging at different level (INFO, WARN,…) when timeouts happen? Thanks in advance.
BlazeClientBuilder[IO](execContext) 
   .withConnectTimeout(configuration.connectTimeout)   
   .withResponseHeaderTimeout(configuration.responseHeaderTimeout)
      .withSslContext(getSslContext)
      .resource
      .allocated
      .unsafeRunSync()
Ostap Strashevskii
@OstapStrashevskii

Hello! Could you help, what is wrong in this code chunk? I have got "Unexpected error reading body" with TickWheelExecutor is shutdown.

val response: F[Response[F]] = resource.use { client =>
   request.flatMap {request => client.toHttpApp.run(request) }
val decResF: F[DecodeResult[F, R]] = response.map(resp => resp.attemptAs[R](jsonOf[F, R]))
val result = decResF.flatMap(_.value)

This look like F exited before application can read and decode response body. If it is, how to prevent it?

ollijh
@liff:matrix.org
[m]
@OstapStrashevskii: i think you should do the decoding inside resource.use
Ostap Strashevskii
@OstapStrashevskii

@OstapStrashevskii: i think you should do the decoding inside resource.use

thanks for your advice! , now I am trying to use expect() for this purpose