good morning!!!!
Skip to content
GitLab
Explore
Sign in
Commits on Source (1)
fix http
· 878732fa
a
authored
Jun 26, 2023
878732fa
Hide whitespace changes
Inline
Side-by-side
contrib/codecs/codecs.go
View file @
878732fa
package
codecs
import
(
"gfx.cafe/open/jrpc/contrib/codecs/http"
"gfx.cafe/open/jrpc/contrib/codecs/inproc"
"gfx.cafe/open/jrpc/contrib/codecs/websocket"
)
var
NewInProc
=
inproc
.
NewCodec
var
WebsocketHandler
=
websocket
.
WebsocketHandler
var
HttpHandler
=
http
.
HttpHandler
contrib/codecs/http/handler.go
View file @
878732fa
package
http
import
(
"gfx.cafe/open/jrpc/pkg/server"
"net/http"
"gfx.cafe/open/jrpc/pkg/server"
)
func
HttpHandler
(
s
*
server
.
Server
)
http
.
Handler
{
return
&
Server
{
Server
:
s
}
}
type
Server
struct
{
Server
*
server
.
Server
}
...
...
contrib/codecs/http/http_test.go
View file @
878732fa
...
...
@@ -14,7 +14,7 @@
// You should have received a copy of the GNU Lesser General Public License
// along with the go-ethereum library. If not, see <http://www.gnu.org/licenses/>.
package
http
package
http
_test
import
(
"net/http"
...
...
@@ -30,8 +30,12 @@ import (
"gfx.cafe/open/jrpc/pkg/server"
"gfx.cafe/open/jrpc/pkg/jrpctest"
.
"gfx.cafe/open/jrpc/contrib/codecs/http"
)
const
contentType
=
"application/json"
const
maxRequestContentLength
=
1024
*
1024
*
5
const
respLength
=
maxRequestContentLength
*
3
func
confirmStatusCode
(
t
*
testing
.
T
,
got
,
want
int
)
{
...
...