MCPcopy Index your code
hub / github.com/bytebase/bytebase / addRequest

Method addRequest

backend/tests/webhook_test.go:38–54  ·  view source on GitHub ↗
(r *http.Request)

Source from the content-addressed store, hash-verified

36}
37
38func (c *webhookCollector) addRequest(r *http.Request) error {
39 defer r.Body.Close()
40 body, err := io.ReadAll(r.Body)
41 if err != nil {
42 return err
43 }
44
45 c.mu.Lock()
46 defer c.mu.Unlock()
47 c.requests = append(c.requests, webhookRequest{
48 Method: r.Method,
49 Headers: r.Header,
50 Body: body,
51 Time: time.Now(),
52 })
53 return nil
54}
55
56func (c *webhookCollector) getRequests() []webhookRequest {
57 c.mu.Lock()

Callers 1

TestWebhookIntegrationFunction · 0.95

Calls 1

CloseMethod · 0.65

Tested by

no test coverage detected