コード例 #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 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
                       ));
        }