Code Monkey home page Code Monkey logo

vial's People

Contributors

alexwennerberg avatar codef0x avatar curiouslycurious avatar ggsvr avatar jebailey avatar moalyousef avatar sigaloid avatar tdryer avatar undefineddarkness avatar xvxx avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

vial's Issues

Possible Windows support?

Hi! So far, I like vial a lot!

However I was wondering if support for Windows is planned? I think that vial would benefit a lot from being cross-platform!

That's all I want to know for now, thanks :).

bundle_files! macro in build.rs causes panic stating "Not a directory"

i have my folder layed out as

.
โ”œโ”€โ”€ assets
โ”‚ย ย  โ”œโ”€โ”€ html
โ”‚ย ย  โ”‚ย ย  โ””โ”€โ”€ index.html
โ”‚ย ย  โ””โ”€โ”€ img
โ”‚ย ย      โ””โ”€โ”€ icon.ico
โ”œโ”€โ”€ build.rs
โ”œโ”€โ”€ Cargo.lock
โ”œโ”€โ”€ Cargo.toml
โ””โ”€โ”€ src
    โ””โ”€โ”€ main.rs

and my build.rs

use vial::bundle_assets;

fn main() {
	bundle_assets!("assets/").expect("unable to bundle assets!");
}

tests fail in windows

Two tests fail when running in a windows environment.
The first is util > file_size. It appears that git will change the line endings of certain files automatically between unix and windows. So instead of finding 1052 and 25161 for the files in the test, it finds 1072 and 25835 respectively.

Additionally, the file_walker test fails. This is actually a problem with the PathBuf object which allows you to construct a path that ends up being a mix of UNIX and Windows-based file path separators. So rather than "tests/assets/rfcs/rfc1288.txt" you get
"tests/assets/rfcs\rfc1288.txt" as the comparison.

Unmaintained (?) + fork

While anxiously awaiting the return of @xvxx from a fishing expedition [1], I forked the repo and made a few improvements. Glad to contribute upstream when the maintainer returns, but until then, I won't make a bunch of PR's for each one.
I accepted #10 #11 #7 #6 + a few others. a list:

  • added proper cookie support, fixed cookies (which were previously broken, only parsing the first cookie)
  • added cookie tests
  • clippy formatting
  • resize threadpool when more than minimum_threads are being used at once (dynamically scale with demand)
  • thread timeout set to 1s (slow loris attack prevention)
  • remote_addr field from #6
  • changed cookie crate to one that is (sort of) compliant
  • added more github actions
  • fixed arithmetic overflow sigaloid#5
  • fixed OOM that would flood memory upon carefully-crafted header sigaloid#7
  • anything you want to contribute personally :D

Link: https://github.com/sigaloid/vial

1: image

`Response::with_*` functions should either panic or state the error

Currently the with_*() functions for Response all have different error-behavior:

  • with_json() panics on serialization failure.
  • with_asset() will instead not panic, continue to execute and return a 404 upon attempting to retrieve the asset. This is the same behavior as if the route isn't even defined. Very confusing.
  • with_file() is the same as with_asset() except that if there is an error opening the file a 500 code with the actual error embedded is returned instead of a 404.

I think it should either be all panic, all returning a 500 with the included error text, a result be propagated somehow or the error message be printed in the "log". 404s are very confusing when the file you are trying to include doesn't exist as it looks like the route doesn't exist instead of the file not existing.

Minimum confusing example:

use vial::{routes, run};

routes! {
    GET "/file" => |_| Response::from_file("I DO NOT EXIST");
}

fn main() {
    _ = run!();
}

Output after two curls:

~ vial running at http://0.0.0.0:7667
GET 404 /file
GET 404 /route_not_existo

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.