Git Product home page Git Product logo

mango's Issues

Potential Middleware: Basic-Auth

Would be nice to have a basic-auth middleware. It should probably accept an 'authenticator' function that verifies a set of credentials? That way it could be very extensible.

Sessions: HMAC instead of SHA1

Please use HMAC instead of doing SHA1 over the concatenation of data and secret to avoid length-extension attacks. Although, the use of gob encoding makes them harder to implement, I think they are still possible.

Thank you!

Bug: Binary static files being served incorrectly

Symptom: Incorrect data is being served by mango.Static for binary files.

Possible cause: The mango.Body type is a string, so binary bytes are typecast to string in mango.Static.

Possible solution: Change mango.Body type to []byte

Error compiling examples

I'm having errors compilings examples folder.

Makefile try to compile silence_middleware and cats_middleware as apps not as libraries.

Potential Middleware: Test module

It might be nice to have a "Test" middleware, where requests could be injected into the app stack, and the responses given extra information about what got called, etc...

Other Thoughts:

  • I'm not 100% sure if this is really needed, since we can do: stack.Compile(handler), and then pass that an Env, or do stack.HandlerFunc(handler), and pass that an http.Request.

Potential Middleware: Lint for validation

It would be nice to have a Lint module so that we could validate the environment, and response.

Other Thoughts:

  • Will probably be a lot simpler than Rack::Lint, because Go is statically-typed, so we primarily just need to check the HTTP spec is being followed. (i.e. status code is >= 100, content-length matches, etc...)

Incompatibilities with HEAD

I presume that these are issues related to newer versions of go:

tobi@i7 ~  $ goinstall github.com/paulbellamy/mango
vgoinstall: === cd /Users/tobi/local/cellar/go/r57.2/src/pkg/github.com/paulbellamy/mango; gomake -f- install
6g  -o _go_.6 jsonp.go logger.go mango.go mime.go routing.go sessions.go show_errors.go static.go 
sessions.go:52: not enough arguments in call to strings.Split
sessions.go:97: env.Request().Cookies undefined (type *Request has no field or method Cookies)
sessions.go:98: typechecking loop
sessions.go:113: cookie.String undefined (type *http.Cookie has no field or method String)
make: *** [_go_.6] Error 1
--- exit status 2
goinstall: installing github.com/paulbellamy/mango: running gomake: exit status 2

Potential Middleware: Caching

It would be awesome to support drop-in http-caching.

Other Thoughts:

  • Will probably want to pass the caching 'stuff' (i.e. how long to cache this for, invalidation, etc...) back from the app via some specific header field (or several)
  • In-memory store would be a great first step, but it would be nice to eventually support redis/memcached/etc... for caching across servers.

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.