Skip to content

moonshinejs.org/editor/ does not compile, CORS issue with distillery.moonshinejs.org #48

@QmarkC

Description

@QmarkC

Steps:

Status shows: "Compliling..."
The POST to http://distrillery.moonshinejs.org returns status 503
Browser console message:

Failed to load http://distillery.moonshinejs.org/: No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://moonshinejs.org' is therefore not allowed access. The response had HTTP status code 503.

MDN Access-Control-Allow-Origin

Request headers:

POST / HTTP/1.1
Host: distillery.moonshinejs.org
Connection: keep-alive
Content-Length: 1640
Origin: http://moonshinejs.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36
Content-Type: multipart/form-data; boundary=----WebKitFormBoundarynBWgpDsoWuwgrpfv
Accept: */*
DNT: 1
Referer: http://moonshinejs.org/editor/
Accept-Encoding: gzip, deflate
Accept-Language: en-US,en;q=0.9

Response Headers:

HTTP/1.1 503 Service Unavailable
Connection: keep-alive
Server: Cowboy
Date: Tue, 19 Dec 2017 15:15:58 GMT
Content-Length: 506
Content-Type: text/html; charset=utf-8
Cache-Control: no-cache, no-store

curl:

curl 'http://distillery.moonshinejs.org/' -H 'Origin: http://moonshinejs.org' -H 'Accept-Encoding: gzip, deflate' -H 'Accept-Language: en-US,en;q=0.9' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_6) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/63.0.3239.84 Safari/537.36' -H 'Content-Type: multipart/form-data; boundary=----WebKitFormBoundarynBWgpDsoWuwgrpfv' -H 'Accept: */*' -H 'Referer: http://moonshinejs.org/editor/' -H 'Connection: keep-alive' -H 'DNT: 1' --data-binary $'------WebKitFormBoundarynBWgpDsoWuwgrpfv\r\nContent-Disposition: form-data; name="lua"\r\n\r\n\r\n \r\n-- A do block provides scoping\r\ndo\r\n    local foo = \'Hello\'\r\n    print(\'Inside the do block, foo is: \', foo)\r\nend\r\n\r\nprint(\'Outside the do block, foo is: \', foo)\r\n\r\n\r\n\r\n\r\n-- if then else\r\n\r\nlocal kittens = 1\r\n\r\nif kittens > 0 then print(\'You have kitten(s)\') end\r\n\r\nif kittens == 0 then \r\n    print(\'You have no kittens\') \r\nelseif kittens == 1 then \r\n    print(\'You have a kitten\') \r\nelse\r\n    print(\'You have many kittens\') \r\nend\r\n\r\n\r\n\r\n-- while\r\n\r\nlocal kittens = { \'Mr Tibbs\', \'Tufty\', \'Kipper\' }\r\n\r\nwhile #kittens > 0 do\r\n    local kitten = table.remove(kittens, 1)\r\n    print(kitten)\r\nend\r\n\r\n\r\n\r\n\r\n-- repeat until\r\n\r\nlocal kittens = { \'Mr Tibbs\', \'Tufty\', \'Kipper\' }\r\n\r\nrepeat \r\n    local kitten = table.remove(kittens, 1)\r\n    print(kitten)\r\nuntil #kittens == 0 \r\n\r\n\r\n\r\n\r\n-- break\r\n\r\nlocal kittens = { \'Mr Tibbs\', \'Tufty\', \'Kipper\' }\r\n\r\nwhile #kittens > 0 do\r\n    local kitten = table.remove(kittens, 1)\r\n    if kitten == \'Tufty\' then break end\r\n    print(kitten)\r\nend\r\n\r\n\r\n\r\n\r\n-- numeric for\r\n\r\nfor i = 1, 10 do            -- count up\r\n    print(i..\' banana\')\r\nend\r\n\r\nfor i = 10, 1, -1 do        -- count down\r\n    print(i..\' green bottles\')\r\nend\r\n\r\nprint(\'i is scoped to the for loop: \', i)\r\n\r\n\r\n\r\n\r\n-- generic for\r\n\r\nlocal random = { \'boot\', foo = \'bar\', 22 }\r\n\r\nfor key, val in ipairs(random) do   -- ipairs iterates over numerical indexed elements only.\r\n    print(key, val) \r\nend\r\n\r\nfor key, val in pairs(random) do   -- pairs iterates over all elements.\r\n    print(key, val) \r\nend\r\n\r\n\r\n\r\n\r\n------WebKitFormBoundarynBWgpDsoWuwgrpfv--\r\n' --compressed

curl response:

<!DOCTYPE html>
	<html>
	  <head>
		<meta name="viewport" content="width=device-width, initial-scale=1">
		<meta charset="utf-8">
		<title>Application Error</title>
		<style media="screen">
		  html,body,iframe {
			margin: 0;
			padding: 0;
		  }
		  html,body {
			height: 100%;
			overflow: hidden;
		  }
		  iframe {
			width: 100%;
			height: 100%;
			border: 0;
		  }
		</style>
	  </head>
	  <body>
		<iframe src="//www.herokucdn.com/error-pages/application-error.html"></iframe>
	  </body>
	</html>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions