diff --git a/epicyon.py b/epicyon.py index 9374416d9..41039c3b6 100644 --- a/epicyon.py +++ b/epicyon.py @@ -844,7 +844,7 @@ if args.actor: if nickname==domain: personUrl=personUrl.replace('/users/','/actor/') #print('personUrl: '+personUrl) - personJson = getJson(session,personUrl,asHeader,None,__version__,httpPrefix,domain) + personJson = getJson(session,personUrl,asHeader,None,__version__,httpPrefix,None) if personJson: pprint(personJson) else: @@ -854,7 +854,7 @@ if args.actor: if args.json: session = createSession(domain,port,True) asHeader = {'Accept': 'application/ld+json; profile="https://www.w3.org/ns/activitystreams"'} - testJson = getJson(session,args.json,asHeader,None,__version__,httpPrefix,domain) + testJson = getJson(session,args.json,asHeader,None,__version__,httpPrefix,None) pprint(testJson) sys.exit() diff --git a/session.py b/session.py index 32691d698..fc947b732 100644 --- a/session.py +++ b/session.py @@ -34,7 +34,9 @@ def getJson(session,url: str,headers: {},params: {}, \ if params: sessionParams=params pythonVersion=str(sys.version_info[0])+'.'+str(sys.version_info[1])+'.'+str(sys.version_info[2]) - sessionHeaders['User-Agent']='Epicyon/'+version+'; +'+httpPrefix+'://'+domain+'/' + sessionHeaders['User-Agent']='Epicyon/'+version + if domain: + sessionHeaders['User-Agent']+='; +'+httpPrefix+'://'+domain+'/' #"Mozilla/5.0 (Linux; Android 5.1.1; Nexus 5)" if not session: print('WARN: no session specified for getJson')