Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
  • Mar 26 07:27
    tyoc213 commented #419
  • Mar 26 07:24
    tyoc213 commented #419
  • Mar 25 21:52
    nyarly commented #411
  • Mar 25 21:51
    nyarly closed #419
  • Mar 25 21:51
    nyarly commented #419
  • Mar 25 21:18
    tyoc213 opened #419
  • Mar 24 20:13
    nyarly opened #418
  • Mar 24 20:12

    nyarly on master

    bind_server: do not exit on pro… bind_server: spawn task per req… Merge pull request #414 from kr… (compare)

  • Mar 24 20:12
    nyarly closed #414
  • Mar 21 20:31
    pksunkara edited #410
  • Mar 09 23:26
    dependabot-preview[bot] edited #323
  • Mar 09 23:26
    dependabot-preview[bot] edited #396
  • Mar 09 23:25
    dependabot-preview[bot] edited #323
  • Mar 09 23:25

    dependabot-preview[bot] on cargo

    (compare)

  • Mar 09 23:25
    dependabot-preview[bot] edited #396
  • Mar 09 23:25

    colinbankier on master

    Update base64 requirement from … (compare)

  • Mar 09 23:25
    colinbankier closed #417
  • Mar 09 10:05
    codecov[bot] commented #417
  • Mar 09 09:56
    codecov[bot] commented #417
  • Mar 09 09:50
    codecov[bot] commented #417
David Laban
@alsuren
@pksunkara I'm going to try to blast through the .to_async() pr today and get it in a state where it's ready to merge (I'm taking it to the london hack-and-learn with me though, so I might be a bit distracted). If it's not done today, I have Monday and Tuesday off work so I will do it then. I will poke you when it's ready for its next round of feedback.
David Laban
@alsuren

@pksunkara yeah... I think .to_async() is as good as I'm able to get it. I don't think I am capable of writing a function that accepts both Future<Output = Result<(_, _), (_, _)>> and either (_, _) or Result<(_, _), (_, _)>.

I have pushed the last refactor that I was planning to do. Do you think it looks ok in its current form?

Pavan Kumar Sunkara
@pksunkara
How about an Enum that takes all 3 of them?
It looks great in current state
I am just trying to think of what it should ideally be to be really great. @alsuren
David Laban
@alsuren
Erm would not work with async FN in the same way that box doesn't work
I would be in favour of merging and iterating, because there scope of this pr has already expanded far too much
David Laban
@alsuren
*Enum
Timur Khuzin
@xuzintimur_twitter
Hi everyone!
How one can get full uri from gotham State?
Better will be if it will be segmented.
David Laban
@alsuren
@xuzintimur_twitter https://github.com/gotham-rs/gotham/blob/master/examples/handlers/request_data/src/main.rs - the Gotham examples are pretty good. I normally grep in the examples folder when I want to know how to do something :D
Timur Khuzin
@xuzintimur_twitter
Ow, thanks you very much.
I checked the examples of path handling but missed this example.
Pavan Kumar Sunkara
@pksunkara
@colinbankier Sorry for bothering you again, but I think we can go ahead with 0.5.0 now, since both the PRs are ready and green
Colin Bankier
@colinbankier
Thanks - I labelled a couple of issues/PRs with the 0.5 milestone https://github.com/gotham-rs/gotham/milestones/0.5
2 PRs are waiting approving review from @whitfin or @nyarly
There are a couple other issues to renable openssl and websocket examples - would be great if someone wanted to take a look at those
Pavan Kumar Sunkara
@pksunkara
@colinbankier I tried the openssl and websocket before, but will give them a try later on. I am currently looking into a routing issue when there are multiple delegations, one with / and another /api. The /api delegation is not working
Pavan Kumar Sunkara
@pksunkara
I fixed this issue. gotham-rs/gotham#410
Nagllort
@Nagllort
Hi everyone!
Nagllort
@Nagllort
How to fix hello_world_until
future::select(server.boxed(), signal.boxed()).await;
   |                           ^^^^^ method not found in `impl hyper::rt::Future`
select accepts Future+Unpin, but gotham::init_server return only Future
Nagllort
@Nagllort
if i use Box::new() then
future::select(Box::new(server), Box::new(signal)).await;
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ within `impl core::future::future::Future`, the trait `std::marker::Unpin` is not implemented for `std::future::GenFuture<[static generator@src/main.rs:45:24: 48:6 _]>`
Pavan Kumar Sunkara
@pksunkara
Examples represent current master.
Use the v0.4.0 tag and see examples
Florian Finkernagel
@TyberiusPrime
Hello channel. I am terribly new to gotham. I'm trying to produce a nice error page. Would y'all be so nice to point me at the right doc/example to read up on this?
Florian Finkernagel
@TyberiusPrime
Ok, So I need a middleware that detects the error, and a default route that still leads to a 404, I suppose...
Florian Finkernagel
@TyberiusPrime
Ok, I got the middleware, I can catch the error status code, now all I need is to replace the body...
Florian Finkernagel
@TyberiusPrime
ok, I have a hyper::body::body::Body, and I need to replace it's contents...
or throw it away and return a new response
Florian Finkernagel
@TyberiusPrime
that works
Florian Finkernagel
@TyberiusPrime
I'm trying to access the request's body in a middleware, but this example has bitrotted away (apperantly concat2 isn't in the current future) gotham-rs/gotham#248
Florian Finkernagel
@TyberiusPrime
ok, so concat2 is back to being just 'concat'. But I appear to have a stream of Results...
Florian Finkernagel
@TyberiusPrime
Now I have a variant that access the body, but panics if there is no body, and I'm too unexperienced to turn it into something sensible...
If I try to match on try_borrow_mut_from and return a body::to_bytes(...).then(|x| chain(state)) from one part and chain(state) from the other, I end up with 'cannot move state'...
because of course it's being borrowed by try_borrow_mut_from...
try_take-from d'oh...
Florian Finkernagel
@TyberiusPrime
yeah, a panic :)
(which makes sense since chain(state) will fail if you have stolen the body)
Florian Finkernagel
@TyberiusPrime
Now I'm stuck at replacing the content of a hyper::Body for my 404 ResponseExtender...
Florian Finkernagel
@TyberiusPrime
of course 'extend_response' is gone...
and so is the calls it used.
truong-pham
@truong-pham
Hi
where can I find error handling example for Gotham?
Pavan Kumar Sunkara
@pksunkara
@colinbankier Looks like some of your maintainers are inactive, can you please go ahead and push forward?
aravk33
@cubetastic33
hello!
I'm trying to figure out what web framework to use
could someone help me with what perks gotham has over other rust frameworks?
Pavan Kumar Sunkara
@pksunkara
@cubetastic33 It has the best middleware and router flexibility, which is basically the only things you care about when comparing between rust frameworks
Nagllort
@Nagllort
Hi everyone!!!
I am trying to set AcceptHeaderRouteMatcher for a post from an association. But that does not work. The program compiles and works, but requests with any mime type get into the handler
 build_router(chain, pipelines, |route| {
        route
            .get("/images/:id:[0-9]+")
            .with_path_extractor::<PathExtractor>()
            .to(get_image);

        let post_matcher = AcceptHeaderRouteMatcher::new(vec![
            mime::APPLICATION_JSON,
            mime::APPLICATION_WWW_FORM_URLENCODED,
            mime::MULTIPART_FORM_DATA,
        ]);

        route.associate("/images", |assoc| {
            assoc.get().to(get_images);
            assoc.post().add_route_matcher(post_matcher).to(post_images);
            assoc.delete().to(delete_image);
            assoc.options().to(delete_image);
        })
    })
Matthew Sanetra
@matthewsanetra
Hi! Gotham looks promising so far! Is there anywhere I can find benchmarks? I don't see it on the TechEmpower Benchmarks
Nagllort
@Nagllort

Hi everyone!!!
I am trying to set AcceptHeaderRouteMatcher for a post from an association. But that does not work. The program compiles and works, but requests with any mime type get into the handler

 build_router(chain, pipelines, |route| {
        route
            .get("/images/:id:[0-9]+")
            .with_path_extractor::<PathExtractor>()
            .to(get_image);

        let post_matcher = AcceptHeaderRouteMatcher::new(vec![
            mime::APPLICATION_JSON,
            mime::APPLICATION_WWW_FORM_URLENCODED,
            mime::MULTIPART_FORM_DATA,
        ]);

        route.associate("/images", |assoc| {
            assoc.get().to(get_images);
            assoc.post().add_route_matcher(post_matcher).to(post_images);
            assoc.delete().to(delete_image);
            assoc.options().to(delete_image);
        })
    })

Sorry, I seem to be dumb

Southball
@southball
Sorry, I am choosing between HTTP server frameworks and Gotham looks quite good. However I want to know how to parse the JSON body of a request (with or without external crates)? Also, any validation on the parsing for the route?
Pavan Kumar Sunkara
@pksunkara
@southball parsing json should be done by serde. There should be an example in the repo
tyoc213
@tyoc213
on #419 would like to know the bad points of following owasp as security assesment for frameworks, if any one could help, it would be great