Skip to content

Commit

Permalink
Merge branch 'bug/seo-suffix-validation'
Browse files Browse the repository at this point in the history
  • Loading branch information
Amir Tocker committed Jan 5, 2017
2 parents 52e3e8e + feddbbb commit ca6fd0f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
14 changes: 7 additions & 7 deletions Cloudinary.Test/ApiTest.cs
Original file line number Diff line number Diff line change
Expand Up @@ -845,13 +845,6 @@ public void TestDisallowUseRootPathIfNotImageUploadForRaw()
m_api.UrlImgUp.UseRootPath(true).PrivateCdn(true).ResourceType("raw").BuildUrl("test");
}

[Test]
[ExpectedException(ExpectedException = typeof(NotSupportedException), ExpectedMessage = "URL Suffix only supported in private CDN!")]
public void TestDisallowUrlSuffixInSharedDistribution()
{
m_api.UrlImgUp.Suffix("hello").BuildUrl("test");
}

[Test]
[ExpectedException(ExpectedException = typeof(NotSupportedException), ExpectedMessage = "URL Suffix only supported for image/upload and raw/upload!")]
public void TestDisallowUrlSuffixInNonUploadTypes()
Expand Down Expand Up @@ -920,6 +913,13 @@ public void TestSupportUrlSuffixForRawUploads()
Assert.AreEqual("http://testcloud-res.cloudinary.com/files/test/hello", actual);
}

[Test]
public void TestSupportUrlSuffixForSharedCdn()
{
string actual = m_api.UrlImgUp.Suffix("hello").Signed(true).Format("jpg").BuildUrl("test");
Assert.AreEqual("http://res.cloudinary.com/testcloud/images/s--1TMilNWq--/test/hello.jpg", actual);
}

[Test]
public void TestResponsiveWidthTransform()
{
Expand Down
3 changes: 0 additions & 3 deletions Cloudinary/Url.cs
Original file line number Diff line number Diff line change
Expand Up @@ -492,9 +492,6 @@ public string BuildUrl(string source)
if (String.IsNullOrEmpty(m_cloudName))
throw new ArgumentException("cloudName must be specified!");

if (!m_usePrivateCdn && !String.IsNullOrEmpty(m_suffix))
throw new NotSupportedException("URL Suffix only supported in private CDN!");

if (source == null)
source = m_source;

Expand Down

0 comments on commit ca6fd0f

Please sign in to comment.