PMunch / nim-playground-frontend

The front-end for https://play.nim-lang.org
45 stars 16 forks source link

I've been redirected to some python code after sharing #30

Closed arkanoid87 closed 2 years ago

arkanoid87 commented 2 years ago

I pasted some nim code and pressed share

I've been presented the following share: https://play.nim-lang.org/#ix=t%20wr

#!/usr/bin/env python

import httplib, sys, urllib, webbrowser

def paste(text):
    conn = httplib.HTTPConnection("sprunge.us")
    params = urllib.urlencode({"sprunge": text})
    headers = { "Content-type": "application/x-www-form-urlencoded",
                "Accept": "text/plain" }
    conn.request("POST", "", params, headers)
    webbrowser.open(conn.getresponse().read())
    conn.close()

if __name__ == '__main__':
    if not sys.stdin.isatty():
        paste(sys.stdin.read())

the clipboard was correct and I saw the correct nim code in window before pressing Share button.