Skip to content
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

Tide logging issue with nested routes — needs investigation #551

Closed
jbr opened this issue May 27, 2020 · 2 comments · Fixed by #662
Closed

Tide logging issue with nested routes — needs investigation #551

jbr opened this issue May 27, 2020 · 2 comments · Fixed by #662

Comments

@jbr
Copy link
Member

jbr commented May 27, 2020

No description provided.

@eribol
Copy link

eribol commented May 27, 2020

This is my nested route:

app.at("/school").nest({
            use crate::school::school::{school, school_detail, timetable, teachers};
            let mut api = tide::with_state(state.clone());
            api.at("").all(school);
            api.at("/:school").all(school_detail);
            api.at("/:school/timetable").all(timetable);
            api.at("/:school/teachers").all(teachers);
            api
        });

and i am requesting to "school/720917/teachers" and logging is:

{"level":30,"time":1590551990049,"msg":"<-- Request received","method":"GET","path":"/school/720917/teachers"}
{"level":30,"time":1590551990049,"msg":"<-- Request received","method":"GET","path":"/720917/teachers"}
{"level":30,"time":1590551990056,"msg":"--> Response sent","method":"GET","path":"/720917/teachers","status":200,"duration":"6.599095ms"}
{"level":30,"time":1590551990056,"msg":"--> Response sent","method":"GET","path":"/school/720917/teachers","status":200,"duration":"6.682995ms"}

but its saying that response of requesting to "/720917/teachers" is okey. And when i tried requesting same route log says:

{"level":30,"time":1590552199144,"msg":"<-- Request received","method":"GET","path":"/720917/teachers"}
{"level":40,"time":1590552199144,"msg":"--> Response sent","method":"GET","path":"/720917/teachers","status":404,"duration":"10.105µs"}

Which its true because there is no route with "/720917/teachers". But logging says its okey. It should not requesting but if it was about requesting, it should response 404.

Sorry for bad language, not native speaker here.

@yoshuawuyts
Copy link
Member

Related: #396

vladan added a commit to vladan/tide that referenced this issue May 31, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue May 31, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue Jun 17, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue Jun 17, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue Jun 17, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue Jun 19, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue Jun 22, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
vladan added a commit to vladan/tide that referenced this issue Jul 11, 2020
Fixes http-rs#396 http-rs#476 http-rs#551 in that it removes the default logging and cookies
middlewares from `Server::with_state()` and allows users to use their
own middlewares, or use the default ones from the framework by calling
`with_cookies()` and/or `with_logging()` on the server instance.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants