Пример #1
0
        public static bool IsMatchRegistrationsBaseUrl(
            this INugetServerProvider provider,
            HttpContext context)
        {
            if (!provider.IsMatchVerbs(context,
                                       HttpMethods.IsHead,
                                       HttpMethods.IsGet))
            {
                return(false);
            }
            return(provider.IsMatchResources(
                       context,
                       NugetServerResourceType.RegistrationsBaseUrl,
                       NugetServerResourceType.RegistrationsBaseUrl_3_0_0_beta,
                       NugetServerResourceType.RegistrationsBaseUrl_3_0_0_rc

                       /*
                        * Gzip does NOT work.
                        */
                       //,
                       //NugetServerResourceType.RegistrationsBaseUrl_3_4_0,
                       //NugetServerResourceType.RegistrationsBaseUrl_3_6_0
                       ) &&
                   provider.IsMatchExtensionName(context, ".json"));
        }
Пример #2
0
        public static bool IsMatchPackagePublishV2Compatible(
            this INugetServerProvider provider,
            HttpContext context)
        {
            if (!provider.IsMatchVerbs(context,
                                       HttpMethods.IsPut,
                                       HttpMethods.IsDelete))
            {
                return(false);
            }

            return(provider.IsMatchResourceIgnoreApiVersion(
                       context,
                       NugetServerResourceType.PackagePublish
                       ));
        }
Пример #3
0
        public static bool IsMatchServerIndex(
            this INugetServerProvider provider,
            HttpContext context)
        {
            if (!provider.IsMatchVerbs(context,
                                       HttpMethods.IsHead,
                                       HttpMethods.IsGet))
            {
                return(false);
            }

            return(provider.IsMatchPath(context,
                                        provider.GetServiceIndexUrlPath()) &&
                   provider
                   .IsMatchExtensionName(context, ".json"));
        }
Пример #4
0
        public static bool IsMatchPackageBaseAddress(
            this INugetServerProvider provider,
            HttpContext context
            )
        {
            if (!provider.IsMatchVerbs(context,
                                       HttpMethods.IsHead,
                                       HttpMethods.IsGet))
            {
                return(false);
            }

            return(provider.IsMatchResource(
                       context,
                       NugetServerResourceType.PackageBaseAddress
                       ));
        }
Пример #5
0
        public static bool IsMatchSearchQueryService(
            this INugetServerProvider provider,
            HttpContext context)
        {
            if (!provider.IsMatchVerbs(context,
                                       HttpMethods.IsHead,
                                       HttpMethods.IsGet))
            {
                return(false);
            }

            return(provider.IsMatchResources(
                       context,
                       NugetServerResourceType
                       .SearchQueryService,
                       NugetServerResourceType
                       .SearchQueryService_3_0_0_beta,
                       NugetServerResourceType
                       .SearchQueryService_3_0_0_rc
                       ));
        }