From bf3669395b675a6cdbdd893ed869bc943daf41de Mon Sep 17 00:00:00 2001 From: ichuang Date: Sat, 5 Jan 2013 16:47:40 +0000 Subject: [PATCH 1/2] update symmath snuggletex server --- lms/lib/symmath/formula.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lms/lib/symmath/formula.py b/lms/lib/symmath/formula.py index 1698b004d9..fb5b210a27 100644 --- a/lms/lib/symmath/formula.py +++ b/lms/lib/symmath/formula.py @@ -422,7 +422,8 @@ class formula(object): def GetContentMathML(self, asciimath, mathml): # URL = 'http://192.168.1.2:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' - URL = 'http://127.0.0.1:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' + # URL = 'http://127.0.0.1:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' + URL = 'http://math-xserver.mitx.mit.edu/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' if 1: payload = {'asciiMathInput': asciimath, From 9a0d85667ca0027d5a4b69f44c9ae56cbc37c5a5 Mon Sep 17 00:00:00 2001 From: ichuang Date: Sat, 5 Jan 2013 17:24:54 +0000 Subject: [PATCH 2/2] symmath use https, no server cert verify --- lms/lib/symmath/formula.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lms/lib/symmath/formula.py b/lms/lib/symmath/formula.py index fb5b210a27..bab0ab3691 100644 --- a/lms/lib/symmath/formula.py +++ b/lms/lib/symmath/formula.py @@ -423,7 +423,7 @@ class formula(object): def GetContentMathML(self, asciimath, mathml): # URL = 'http://192.168.1.2:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' # URL = 'http://127.0.0.1:8080/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' - URL = 'http://math-xserver.mitx.mit.edu/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' + URL = 'https://math-xserver.mitx.mit.edu/snuggletex-webapp-1.2.2/ASCIIMathMLUpConversionDemo' if 1: payload = {'asciiMathInput': asciimath, @@ -431,7 +431,7 @@ class formula(object): #'asciiMathML':unicode(mathml).encode('utf-8'), } headers = {'User-Agent': "Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.13) Gecko/20080311 Firefox/2.0.0.13"} - r = requests.post(URL, data=payload, headers=headers) + r = requests.post(URL, data=payload, headers=headers, verify=False) r.encoding = 'utf-8' ret = r.text #print "encoding: ",r.encoding