Code Monkey home page Code Monkey logo

Comments (6)

paulstraw avatar paulstraw commented on July 17, 2024

This should be working, according to this test: https://github.com/raynjamin/Imgix-CSharp/blob/master/Imgix-CSharp-Tests/ImgixBlueprintTests.cs#L65

Can you send through the output URLs you get from the web tool and this library?

from imgix-csharp.

BenjaminGibbs avatar BenjaminGibbs commented on July 17, 2024

This is the output I get from signing using a proxy setup;

Input/Request:

GET https://osc-proxy.imgix.net/https:%2F%2Fs-media-cache-ak0.pinimg.com%2Foriginals%2F36%2F70%2Fb6%2F3670b61e7e8e43d68626c0d0347b73b9.jpg?s=ebc1d9aa6cd2df5c71b9f8bf19293008 HTTP/1.1
Host: osc-proxy.imgix.net
Connection: keep-alive
Cache-Control: max-age=0
Upgrade-Insecure-Requests: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
Accept-Encoding: gzip, deflate, sdch, br
Accept-Language: en-US,en;q=0.8

Output/Response:

HTTP/1.1 401 Unauthorized
Server: imgix-fe
Cache-Control: max-age=300
Fastly-Debug-Digest: 1d0bcd8664dd47b31c079909f719b294a394a9b3eeadec8c528276adf83447b7
Content-Length: 26
Accept-Ranges: bytes
Date: Mon, 07 Nov 2016 04:15:12 GMT
Age: 22
Connection: keep-alive
Content-Type: image/jpeg
X-Imgix-Request-ID: 7c53387b70458b17ac87377b36f1fb287d07bc5d
X-Content-Type-Options: nosniff
X-Served-By: cache-lax8634-LAX, cache-lhr6349-LHR
X-Cache: MISS, HIT
X-Cache-Hits: 0, 1

URI signature match failed

from imgix-csharp.

paulstraw avatar paulstraw commented on July 17, 2024

@BenjaminGibbs sorry for the miscommunication, could you send through the URL you're passing to the library to get https://osc-proxy.imgix.net/https:%2F%2Fs-media-cache-ak0.pinimg.com%2Foriginals%2F36%2F70%2Fb6%2F3670b61e7e8e43d68626c0d0347b73b9.jpg?s=ebc1d9aa6cd2df5c71b9f8bf19293008 as output?

from imgix-csharp.

paulstraw avatar paulstraw commented on July 17, 2024

The error is being caused by the unencoded : in the https://. If that's encoded properly, it works as expected: https://osc-proxy.imgix.net/https%3A%2F%2Fs-media-cache-ak0.pinimg.com%2Foriginals%2F36%2F70%2Fb6%2F3670b61e7e8e43d68626c0d0347b73b9.jpg?s=ebc1d9aa6cd2df5c71b9f8bf19293008

from imgix-csharp.

BenjaminGibbs avatar BenjaminGibbs commented on July 17, 2024

So this is my code:

Dim l As New List(Of String)
l.Add("osc-proxy.imgix.net")
Dim urlBuilder = New UrlBuilder(l.ToArray, True)
urlBuilder.SignKey = "xxx"
Console.WriteLine(urlBuilder.BuildUrl("https://s-media-cache-ak0.pinimg.com/originals/36/70/b6/3670b61e7e8e43d68626c0d0347b73b9.jpg"))

However great spot with the URL being wrong, the error appears to be with visual studio. I was using the console.writeline as per above, when I clicked on the URL in the output window VS transformed it from

https://osc-proxy.imgix.net/https%3A%2F%2Fs-media-cache-ak0.pinimg.com%2Foriginals%2F36%2F70%2Fb6%2F3670b61e7e8e43d68626c0d0347b73b9.jpg?s=ebc1d9aa6cd2df5c71b9f8bf19293008

to

https://osc-proxy.imgix.net/https:%2F%2Fs-media-cache-ak0.pinimg.com%2Foriginals%2F36%2F70%2Fb6%2F3670b61e7e8e43d68626c0d0347b73b9.jpg?s=ebc1d9aa6cd2df5c71b9f8bf19293008

If I copied and paste it directly it works fine, thanks for your help - sorry for taking up your time.

from imgix-csharp.

paulstraw avatar paulstraw commented on July 17, 2024

Oh, awesome! Glad it's actually working. It's funny how our most useful tools can sometimes be our worst enemies, too!

from imgix-csharp.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.