Merge branch 'master' into add-timeout-to-test-framework

This commit is contained in:
Aaron Blankstein
2017-08-15 10:42:12 -04:00
4 changed files with 26 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
# Blockstack Core
[![PyPI](https://img.shields.io/pypi/v/blockstack.svg)](https://pypi.python.org/pypi/blockstack/)
[![Slack](http://slack.blockstack.org/badge.svg)](http://slack.blockstack.org/)
[![Slack](https://img.shields.io/badge/join-slack-e32072.svg?style=flat)](http://slack.blockstack.org/)
Blockstack is a new decentralized internet where you own your data and your apps run locally without remote servers.

View File

@@ -138,6 +138,8 @@ from .data import datastore_mkdir, datastore_rmdir, make_datastore_info, put_dat
from .schemas import OP_URLENCODED_PATTERN, OP_NAME_PATTERN, OP_USER_ID_PATTERN, OP_BASE58CHECK_PATTERN
import keylib
import virtualchain
from virtualchain.lib.ecdsalib import *
@@ -4386,9 +4388,10 @@ def cli_verify_profile( args, config_path=CONFIG_PATH, proxy=None, interactive=F
if hasattr(args, 'pubkey') and args.pubkey is not None:
pubkey = str(args.pubkey)
try:
pubkey = ECPublicKey(pubkey).to_hex()
except:
return {'error': 'Invalid public key'}
pubkey = keylib.ECPublicKey(pubkey).to_hex()
except Exception as e:
log.exception(e)
return {'error': 'Invalid public key : "{}"'.format(pubkey)}
if pubkey is None:
zonefile_data = None

View File

@@ -24,4 +24,4 @@
__version_major__ = '0'
__version_minor__ = '14'
__version_patch__ = '4'
__version__ = '{}.{}.{}.1'.format(__version_major__, __version_minor__, __version_patch__)
__version__ = '{}.{}.{}.2'.format(__version_major__, __version_minor__, __version_patch__)

View File

@@ -364,12 +364,27 @@ class SubdomainRegistrarRPCWorker(threading.Thread):
self.server.serve_forever()
class SubdomainRegistrarRPCHandler(BaseHTTPServer.BaseHTTPRequestHandler):
def send_message(self, code, message):
def send_message(self, code, message):
self.send_response(code)
self.send_header("Content-Type", "application/json")
self.send_header("Access-Control-Allow-Origin", "*")
self.send_header("Content-Type", "application/json")
self.end_headers()
self.wfile.write(message + "\r\n")
def do_OPTIONS(self):
"""
Give back CORS preflight check headers
"""
self.send_response(200)
self.send_header('Access-Control-Allow-Origin', '*') # CORS
self.send_header('Access-Control-Allow-Methods', 'GET, POST')
self.send_header('Access-Control-Allow-Headers', 'content-type, authorization, range')
self.send_header('Access-Control-Expose-Headers', 'content-length')
self.send_header('Access-Control-Max-Age', 21600)
self.end_headers()
return
def do_GET(self):
path = self.path
if path[-1] == "/":
@@ -422,7 +437,7 @@ class SubdomainLock(object):
pid = -1
return pid != os.getpid()
@staticmethod
def lockfile_write( fd ):
def lockfile_write( fd ):
buf = "%s\n" % os.getpid()
nw = 0
while nw < len(buf):