You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: abuse_protection.go
    path of file: ./repos/plumber/vendor/github.com/cloudevents/sdk-go/v2/protocol/http
    
    the code of the file until where you have to start completion: /*
 Copyright 2021 The CloudEvents Authors
 SPDX-License-Identifier: Apache-2.0
*/

package http

import (
	"context"
	cecontext "github.com/cloudevents/sdk-go/v2/context"
	"go.uber.org/zap"
	"net/http"
	"strconv"
	"strings"
	"time"
)

type WebhookConfig struct {
	AllowedMethods  []string // defaults to POST
	Al
    
func (p *Protocol) validateOrigin(ro string) (string, bool) {
	cecontext.LoggerFrom(context.TODO()).Infow("Validating origin.", zap.String("origin", ro))

	for _, ao := range p.WebhookConfig.AllowedOrigins {
		if ao == "*" {
			return ao, true
		}
		// TODO: it is not clear what the rules for allowed hosts are.
		// Need to find docs for this. For now, test for prefix.
		if strings.HasPrefix(ro, ao) {
			return ao, true
		}
	}

	return ro, false
}