andyg
08/06/2020, 3:36 PMRiku
08/06/2020, 5:20 PMCosmin Victor Celea
08/07/2020, 1:08 PMdave
08/13/2020, 11:47 AMVeeti Paananen
08/17/2020, 8:57 AMElizabeth Thomas
08/17/2020, 8:49 PMMetricFilters.Server.RequestTimer
? I seem to get only the count
, mean
, sum
and upper
fields from http.server.request.latency
metric published using the RequestTimer
metric filter.Cosmin Victor Celea
09/02/2020, 9:58 AMPath.of("system", "The target system ") / "/feed"
.
Exception in thread "main" java.lang.IllegalArgumentException: Fixed path segments cannot contain /. Use the "a / b" form.
Any ideas?s4nchez
09/02/2020, 10:09 AMzero_coding
09/02/2020, 12:50 PMzero_coding
09/03/2020, 9:17 PMCosmin Victor Celea
09/09/2020, 10:23 AMdave
09/14/2020, 12:36 PMdave
09/16/2020, 5:43 AMJames Richardson
09/16/2020, 8:19 AMfredrik.nordin
09/16/2020, 8:48 AMCosmin Victor Celea
09/16/2020, 1:04 PMdave
09/16/2020, 3:21 PMMehdi
09/21/2020, 2:06 PMpabl0rg
09/21/2020, 9:43 PMdave
09/23/2020, 1:06 PMRodrigo Navarro
09/23/2020, 5:02 PMfun create(
clientId: ClientId,
tokenRequest: AuthorizationCodeAccessTokenRequest,
authorizationCode: AuthorizationCode
): Result<AccessToken, AuthorizationCodeAlreadyUsed>
I need a way to associate the access token with the authenticated user here. I was thinking that I could use the requests contexts api to pass the logged user somehow, but this method doesn’t have access the request object. I don’t know if I am not seeing something obvious here, but I can’t find a way to implement this.dave
09/25/2020, 12:35 PMRazvan
09/26/2020, 3:39 PMval codeField = FormField.required("code")
val pageForm = Body
.webForm(Validator.Strict, codeField)
.toLens()
val validForm = pageForm(request)
val code = codeField(validForm)
but when I call the api from a static JS fetch request I get a 500 error:
org.http4k.lens.LensFailure: header 'content-type' is not acceptable
for the last line of code.
Why does it check the content-type header if it's a Body lens ? And how to get around with it ?
the JS fetch request is:
fetch{"/check", {
method: "post",
body: "code=XXXX"
})
tried with FormData and multipart got the same error.sahil Lone
10/08/2020, 6:20 AMCosmin Victor Celea
10/08/2020, 2:52 PMobobo
10/08/2020, 7:20 PM2020-10-08T19:17:15.008682Z [WARN] An exceptionCaught() event was fired, and it reached at the tail of the pipeline. It usually means the last handler in the pipeline did not handle the exception. exception_message=Connection reset by peer exception_name=java.io.IOException
Is there something I can setup to avoid this stacktrace? I assume this is because of keepalive.Razvan
10/10/2020, 8:31 PM@Test
fun `Lens exemple`() {
data class User(val name: String, val age: Int)
val idLens = <http://Path.int|Path.int>().of("id")
val jsonBody = Body.auto<User>().toLens()
val user: HttpHandler = routes(
"users/{id}" bind GET to { r: Request ->
jsonBody.inject(User("Tom", 30 + idLens.extract(r)), Response(OK))
}
)
val responseOk = user(Request(GET, "users/2"))
val resposeObject = jsonBody.extract(responseOk)
resposeObject.age shouldBe 32
}
But I get a Parser error:
Signature Parse error: expected '<' or ';' but got
Remaining input: exemple$User;>;
If I move the User
class out of the function is all good, but I was wandering it it’s supposed to not work or it’s a bug and should I report it (and if so, to whom is it your fault or Jackson’s).Razvan
10/12/2020, 3:54 PMapp.asServer(ApacheServer(8080))
accessing from <http://localhost:8080>
no problem, but trying using the loopback ip 127.0.0.1
or 0.0.0.0
didn't work.
➜ curl --verbose <http://127.0.0.1:8080>
* Trying 127.0.0.1:8080...
* TCP_NODELAY set
* Connected to 127.0.0.1 (127.0.0.1) port 8080 (#0)
> GET / HTTP/1.1
> Host: 127.0.0.1:8080
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 400 Bad Request
< Connection: close
< Date: Mon, 12 Oct 2020 13:36:26 GMT
< Server: Apache-HttpCore/5.0.2 (Java/11.0.8)
< Content-Length: 17
< Content-Type: text/plain; charset=ISO-8859-1
<
* Closing connection 0
Not authoritative%
I tried specify the address to the server app.asServer(ApacheServer(8080, InetAddress.getByName("0.0.0.0")))
but no luck either.
Finally gave up and move to Jetty which worked as a charm, but still wanting to know if you have an explanation or a configuration that should work with Apache.
Thanks.dave
10/14/2020, 7:37 PMRazvan
10/15/2020, 12:29 PMRazvan
10/15/2020, 12:29 PMval appRoutes = listOf(
if (condition1) Route1() else null,
if (condition2) Route2() else null,
)
routes(*appRoutes.filterNotNull().toTypedArray())