This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use axum::{body::Body, http::StatusCode, response::IntoResponse, routing::get, Router}; | |
use futures::Stream; | |
use std::pin::Pin; | |
use std::task::{Context, Poll}; | |
use tokio::io::{AsyncBufReadExt, AsyncRead, AsyncReadExt, BufReader, ReadBuf}; | |
use tokio::net::{TcpListener, TcpStream}; | |
use tower_http::cors::CorsLayer; | |
// This struct represent a stream and an amount of bytes to read from it | |
struct LimitedStream { |