From c15bf1dff332873644290db0e186b8f5ad9b8fb2 Mon Sep 17 00:00:00 2001 From: Máximo Cuadros Date: Thu, 1 Dec 2016 09:59:19 +0100 Subject: capabilities: full integration (#151) * format/pktline: fix readPayloadLen err handling * protocol/pakp: UploadReq validation and creation of capabilities * protocol/pakp: AdvRef tests * protocol/pakp: capability.List.Delete * protocol: filter unsupported capabilities * remote capability negociation * transport: UploadRequest validation * requested changes --- plumbing/transport/internal/common/common.go | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'plumbing/transport/internal/common') diff --git a/plumbing/transport/internal/common/common.go b/plumbing/transport/internal/common/common.go index 10e395e..56edab0 100644 --- a/plumbing/transport/internal/common/common.go +++ b/plumbing/transport/internal/common/common.go @@ -162,6 +162,7 @@ func (s *session) AdvertisedReferences() (*packp.AdvRefs, error) { return nil, err } + transport.FilterUnsupportedCapabilities(ar.Capabilities) return ar, nil } @@ -172,6 +173,10 @@ func (s *session) FetchPack(req *packp.UploadPackRequest) (io.ReadCloser, error) return nil, transport.ErrEmptyUploadPackRequest } + if err := req.Validate(); err != nil { + return nil, err + } + if !s.advRefsRun { if _, err := s.AdvertisedReferences(); err != nil { return nil, err -- cgit