diff --git a/captcha.go b/captcha.go index 8bdd7cd..71dfbd0 100644 --- a/captcha.go +++ b/captcha.go @@ -28,12 +28,6 @@ import ( "gopkg.in/macaron.v1" ) -const _VERSION = "0.1.0" - -func Version() string { - return _VERSION -} - var ( defaultChars = []byte{0, 1, 2, 3, 4, 5, 6, 7, 8, 9} ) @@ -242,10 +236,10 @@ func Captchaer(options ...Options) macaron.Handler { } } + ctx.Status(200) if _, err := NewImage([]byte(chars), cpt.StdWidth, cpt.StdHeight, cpt.ColorPalette).WriteTo(ctx.Resp); err != nil { panic(fmt.Errorf("write captcha: %v", err)) } - ctx.Status(200) return } diff --git a/captcha_test.go b/captcha_test.go index 1c4391b..6b6175f 100644 --- a/captcha_test.go +++ b/captcha_test.go @@ -24,12 +24,6 @@ import ( "gopkg.in/macaron.v1" ) -func Test_Version(t *testing.T) { - Convey("Get version", t, func() { - So(Version(), ShouldEqual, _VERSION) - }) -} - func Test_Captcha(t *testing.T) { Convey("Captch service", t, func() { m := macaron.New()