Azure Storage GET not working with url shortner (CORS set to all domain *)

Robin Tan 61 Reputation points
2021-07-29T16:35:03.637+00:00

I'm using a url shortner (custom hosted yourls) to redirect to a html page on azure blob storage. It works on a browser but when I do a GET without headers (I need this), it gives me an error.

I have set on CORS on azure storage to allow everything already

119117-image.png

I tested with test-cors.org and it gives me

Sending GET request to https://yourls.com/testurl  
  
Fired XHR event: loadstart  
Fired XHR event: readystatechange  
Fired XHR event: error  
Azure Blob Storage
Azure Blob Storage
An Azure service that stores unstructured data in the cloud as blobs.
3,192 questions
0 comments No comments
{count} votes

Accepted answer
  1. Tim Leyden 346 Reputation points
    2021-08-01T22:18:51.613+00:00

    Given that it works with tinyurl and not your custom service I would focus on what is difference between these two services. When i test with test-cors and tinyurl I can see a cors http header in the response: access-control-allow-origin: http://test-cors.org. Your storage account config looks as permissive as it can get and if that tests okay from test-cors when you use the storage url directly i would be looking elsewhere.

    Tim


2 additional answers

Sort by: Most helpful
  1. deherman-MSFT 38,021 Reputation points Microsoft Employee Moderator
    2021-07-29T20:51:45.28+00:00

    @Robin Tan

    I just tested this using tinyurl and did not have any issues making a GET request to the tinyurl. I suspect this might be an issue specific to the URL shortener you are using. I recommend testing with some common URL shorteners to see if you are still facing issue. If it is specific to this URL shortener I recommend investigating and perhaps opening up an issue on their GitHub page.

    Hope this helps. Let me know if you have further questions or issues and I will be happy to assist.

    -------------------------------

    Please don’t forget to "Accept the answer" and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.

    0 comments No comments

  2. Robin Tan 61 Reputation points
    2021-07-30T00:50:29.26+00:00

    Hi Deherman, you are correct. It does work on tinyurl, but not yourls. Anyway on the azure storage side to diagnose it (see header request etc?). I could switch shortner but I like to know to diagnose, if possible.


Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.