GithubHelp home page GithubHelp logo

Comments (8)

codegangsta avatar codegangsta commented on June 9, 2024

I haven't seen it before, but I will check it out. Might be a bug in the static handler

Sent from my iPhone

On Nov 16, 2013, at 9:36 AM, Brent Anderson [email protected] wrote:

package main

import "github.com/codegangsta/martini"

func main() {
m := martini.Classic()
m.Get("/", func() string {
return "Hello world!"
})
m.Run()
}
Building, running and then browsing :3000 initiates a download of the built executable (5.3MB). Changing the path to '/test' and browsing :3000/test will return "Hello world!". This is on OSX Mavericks and tested with Go 1.1 and Go 1.2.

Running the default net/http server example on :3000 work just fine.

This is pretty bizarre behavior. Have you seen it before?


Reply to this email directly or view it on GitHub.

from martini.

codegangsta avatar codegangsta commented on June 9, 2024

Looking into this now

from martini.

codegangsta avatar codegangsta commented on June 9, 2024

I am not able to reproduce this with the latest version of martini (af1b7cc). This does seem like very odd behavior, and very insecure. If you could give me a little more information (log output, sample program, test case) it would be greatly appreciated

from martini.

DisposaBoy avatar DisposaBoy commented on June 9, 2024

is the binary named public by any chance. e.g. you put main.go in a directory called public and then called go build or used a tool that does to run it

from martini.

codegangsta avatar codegangsta commented on June 9, 2024

Hah, yeah that would be the only thing I can think of at the moment

On Sat, Nov 16, 2013 at 10:55 AM, DisposaBoy [email protected]:

is the binary named public by any chance. e.g. you put main.go in a
directory called public and then called go build or used a tool that does
to run it


Reply to this email directly or view it on GitHubhttps://github.com//issues/50#issuecomment-28633127
.

from martini.

brentmn avatar brentmn commented on June 9, 2024

@DisposaBoy, exactly! I had thought about this but only tested by installing and running the binary from bin rather than renaming the directory; not the right test. @codegangsta, I'll rename my folder for now. Not sure if there's much else you can do about it.

from martini.

codegangsta avatar codegangsta commented on June 9, 2024

@brentmn Not to much to do except documentation. Closing this issue out

from martini.

brentmn avatar brentmn commented on June 9, 2024

I would consider removing the default static folder or allowing it to be overwritten when calling martini.Static(...)

from martini.

Related Issues (20)

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.