Why can I use "http://localhost:PORT" with CORS in Spaces?

Safari doesn’t respect my wildcard rule in CORS but Firefox and Chrome do. None of the suggestions in this StackOverflow post helped either:

I feel like this could be remedied if Spaces was configured to allow a URL without a TLD.

Show comments

Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Andrew SB
DigitalOcean Employee
DigitalOcean Employee badge
February 28, 2018
Accepted Answer

Thanks for flagging this issue for us. It looks like the input validation in our control panel is a bit too strict here. As a work-around until this experience is improved, you can create CORs configurations for Spaces using the API for origins without a TLD. For example, using s3cmd you can run:

  1. s3cmd setcors cors.xml s3://example-space

Where the contents of the cors.xml file contains your CORs configurations in XML format. For example:




So the year has gone by and it still isn’t possible to set as a cors via the control panel

CORS options are now available thru DigitalOcean Dashboard. If you are facing this problem:

  1. Go to
  2. Select your Space
  3. Go to Settings tab
  4. On “CORS Configurations”, click on the “+” (Plus) button

Create a new configuration with this values:

  • Origin: *
  • Allowed Methods: GET
  • Allowed Headers: Click “Add header” an them: *
  • Save options

Should work.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel