Giter VIP home page Giter VIP logo

simple-http's People

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

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

simple-http's Issues

clean-up

I'm using simple-http to serve a few static files from within a game. Everything is working great, so thanks!
I was wondering if there is any type of clean-up that I need to do when shutting down the server? I couldn't find anything about that in the samples or in your code-project article.

Thread Safety & Static Route handling

Hey,
I've noticed that the Method collection is a simple list which is NOT thread safe. Using it in a multithreaded application (==Task.Run) can result in weird behaviour which could potentially destroy the process.
I suggest moving to a collection from System.Collections.Concurrent or using an access lock object and locking it with "lock(object){}". You should pay attention to deadlocks.

Another thing which i noticed is that the Route class is static which isnt optimal. There are 2 reasons which came to my mind:

  1. Testability. You will have a hard time Unit Testing your application.
  2. Multiple server instances with different behaviours are not possible with the current approach.

I hope you find those suggestion helpful

how decide a valid post request

"application/x-www-form-urlencoded;charset=UTF-8" is not treated as post request, simple-http cannot get values.

in RequestExtensions.Form.cs, we only treat ContentType == "application/x-www-form-urlencoded" as a valid post request, maybe we can use IndexOf method to decide?

static bool ParseForm(HttpListenerRequest request, Dictionary<string, string> args)
        {
            if (request.ContentType != "application/x-www-form-urlencoded")
                return false;

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.