MCPcopy Index your code
hub / github.com/ContainerSSH/ContainerSSH / OnRequest

Method OnRequest

http/integration_test.go:39–57  ·  view source on GitHub ↗
(request http2.ServerRequest, response http2.ServerResponse)

Source from the content-addressed store, hash-verified

37}
38
39func (s *handler) OnRequest(request http2.ServerRequest, response http2.ServerResponse) error {
40 req := Request{}
41 if err := request.Decode(&req); err != nil {
42 return err
43 }
44 if req.Message == "Hi" {
45 response.SetBody(&Response{
46 Error: false,
47 Message: "Hello world!",
48 })
49 } else {
50 response.SetStatus(400)
51 response.SetBody(&Response{
52 Error: true,
53 Message: "Be nice and greet me!",
54 })
55 }
56 return nil
57}
58
59func TestUnencrypted(t *testing.T) {
60 clientConfig, serverConfig := createClientServerConfig(t)

Callers

nothing calls this directly

Calls 3

DecodeMethod · 0.65
SetBodyMethod · 0.65
SetStatusMethod · 0.65

Tested by

no test coverage detected