Skip to content

Commit ca6fd0f

Browse files
author
Amir Tocker
committed
Merge branch 'bug/seo-suffix-validation'
2 parents 52e3e8e + feddbbb commit ca6fd0f

File tree

2 files changed

+7
-10
lines changed

2 files changed

+7
-10
lines changed

Cloudinary.Test/ApiTest.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -845,13 +845,6 @@ public void TestDisallowUseRootPathIfNotImageUploadForRaw()
845845
m_api.UrlImgUp.UseRootPath(true).PrivateCdn(true).ResourceType("raw").BuildUrl("test");
846846
}
847847

848-
[Test]
849-
[ExpectedException(ExpectedException = typeof(NotSupportedException), ExpectedMessage = "URL Suffix only supported in private CDN!")]
850-
public void TestDisallowUrlSuffixInSharedDistribution()
851-
{
852-
m_api.UrlImgUp.Suffix("hello").BuildUrl("test");
853-
}
854-
855848
[Test]
856849
[ExpectedException(ExpectedException = typeof(NotSupportedException), ExpectedMessage = "URL Suffix only supported for image/upload and raw/upload!")]
857850
public void TestDisallowUrlSuffixInNonUploadTypes()
@@ -920,6 +913,13 @@ public void TestSupportUrlSuffixForRawUploads()
920913
Assert.AreEqual("http://testcloud-res.cloudinary.com/files/test/hello", actual);
921914
}
922915

916+
[Test]
917+
public void TestSupportUrlSuffixForSharedCdn()
918+
{
919+
string actual = m_api.UrlImgUp.Suffix("hello").Signed(true).Format("jpg").BuildUrl("test");
920+
Assert.AreEqual("http://res.cloudinary.com/testcloud/images/s--1TMilNWq--/test/hello.jpg", actual);
921+
}
922+
923923
[Test]
924924
public void TestResponsiveWidthTransform()
925925
{

Cloudinary/Url.cs

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -492,9 +492,6 @@ public string BuildUrl(string source)
492492
if (String.IsNullOrEmpty(m_cloudName))
493493
throw new ArgumentException("cloudName must be specified!");
494494

495-
if (!m_usePrivateCdn && !String.IsNullOrEmpty(m_suffix))
496-
throw new NotSupportedException("URL Suffix only supported in private CDN!");
497-
498495
if (source == null)
499496
source = m_source;
500497

0 commit comments

Comments
 (0)