{"action":"created","issue":{"url":"https://api.github.com/repos/kataras/iris/issues/246","repository_url":"https://api.github.com/repos/kataras/iris","labels_url":"https://api.github.com/repos/kataras/iris/issues/246/labels{/name}","comments_url":"https://api.github.com/repos/kataras/iris/issues/246/comments","events_url":"https://api.github.com/repos/kataras/iris/issues/246/events","html_url":"https://github.com/kataras/iris/issues/246","id":163154197,"number":246,"title":"possibility/method compat with 'standard' http.Handler","user":{"login":"ghiewa","id":72506,"avatar_url":"https://avatars.githubusercontent.com/u/72506?v=3","gravatar_id":"","url":"https://api.github.com/users/ghiewa","html_url":"https://github.com/ghiewa","followers_url":"https://api.github.com/users/ghiewa/followers","following_url":"https://api.github.com/users/ghiewa/following{/other_user}","gists_url":"https://api.github.com/users/ghiewa/gists{/gist_id}","starred_url":"https://api.github.com/users/ghiewa/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ghiewa/subscriptions","organizations_url":"https://api.github.com/users/ghiewa/orgs","repos_url":"https://api.github.com/users/ghiewa/repos","events_url":"https://api.github.com/users/ghiewa/events{/privacy}","received_events_url":"https://api.github.com/users/ghiewa/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-06-30T12:33:12Z","updated_at":"2016-06-30T12:57:12Z","closed_at":null,"body":"is there any way to convert back http.Handler\r\nsay,\r\n\r\n```\r\nfunc Handler() http.Handler {\r\n\tr := iris.New()\r\n\r\n\tr.Get(\"/form/:glid\", itemSpreadsheet)\r\n\tr.Post(\"/save/:glid\", itemSave)\r\n\treturn iris.ToHandler(r).(http.Handler)\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/kataras/iris/issues/comments/229650001","html_url":"https://github.com/kataras/iris/issues/246#issuecomment-229650001","issue_url":"https://api.github.com/repos/kataras/iris/issues/246","id":229650001,"user":{"login":"kataras","id":2321588,"avatar_url":"https://avatars.githubusercontent.com/u/2321588?v=3","gravatar_id":"","url":"https://api.github.com/users/kataras","html_url":"https://github.com/kataras","followers_url":"https://api.github.com/users/kataras/followers","following_url":"https://api.github.com/users/kataras/following{/other_user}","gists_url":"https://api.github.com/users/kataras/gists{/gist_id}","starred_url":"https://api.github.com/users/kataras/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kataras/subscriptions","organizations_url":"https://api.github.com/users/kataras/orgs","repos_url":"https://api.github.com/users/kataras/repos","events_url":"https://api.github.com/users/kataras/events{/privacy}","received_events_url":"https://api.github.com/users/kataras/received_events","type":"User","site_admin":false},"created_at":"2016-06-30T12:57:12Z","updated_at":"2016-06-30T12:57:12Z","body":"reverse this:\r\n\r\n```go\r\nreturn func(ctx *fasthttp.RequestCtx) {\r\n\t\tvar r http.Request\r\n\r\n\t\tbody := ctx.PostBody()\r\n\t\tr.Method = string(ctx.Method())\r\n\t\tr.Proto = \"HTTP/1.1\"\r\n\t\tr.ProtoMajor = 1\r\n\t\tr.ProtoMinor = 1\r\n\t\tr.RequestURI = string(ctx.RequestURI())\r\n\t\tr.ContentLength = int64(len(body))\r\n\t\tr.Host = string(ctx.Host())\r\n\t\tr.RemoteAddr = ctx.RemoteAddr().String()\r\n\r\n\t\thdr := make(http.Header)\r\n\t\tctx.Request.Header.VisitAll(func(k, v []byte) {\r\n\t\t\tsk := string(k)\r\n\t\t\tsv := string(v)\r\n\t\t\tswitch sk {\r\n\t\t\tcase \"Transfer-Encoding\":\r\n\t\t\t\tr.TransferEncoding = append(r.TransferEncoding, sv)\r\n\t\t\tdefault:\r\n\t\t\t\thdr.Set(sk, sv)\r\n\t\t\t}\r\n\t\t})\r\n\t\tr.Header = hdr\r\n\t\tr.Body = &netHTTPBody{body}\r\n\t\trURL, err := url.ParseRequestURI(r.RequestURI)\r\n\t\tif err != nil {\r\n\t\t\tctx.Logger().Printf(\"cannot parse requestURI %q: %s\", r.RequestURI, err)\r\n\t\t\tctx.Error(\"Internal Server Error\", fasthttp.StatusInternalServerError)\r\n\t\t\treturn\r\n\t\t}\r\n\t\tr.URL = rURL\r\n\r\n\t\tvar w netHTTPResponseWriter\r\n\t\th.ServeHTTP(&w, &r)\r\n\r\n\t\tctx.SetStatusCode(w.StatusCode())\r\n\t\tfor k, vv := range w.Header() {\r\n\t\t\tfor _, v := range vv {\r\n\t\t\t\tctx.Response.Header.Set(k, v)\r\n\t\t\t}\r\n\t\t}\r\n\t\tctx.Write(w.body)\r\n\t}\r\n\r\n```\r\n\r\nI am not recommending doing these things, why you want to convert it to net/http, work with Iris no need to work with net/http also.."}}
{"actor":{"display_login":"kataras"}}