diff options
author | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-29 07:24:32 +0000 |
---|---|---|
committer | jsdelfino <jsdelfino@13f79535-47bb-0310-9956-ffa450edef68> | 2010-12-29 07:24:32 +0000 |
commit | 2fedb4a4b67f7856bbfc5d1508524ef9c3d85942 (patch) | |
tree | db1669ec28075f3866ef5ab4e71eb57f4299bb40 /sca-cpp/trunk/modules/wsgi | |
parent | 788cba4bc8028279dcf8dcd1ac192f0ce078a971 (diff) |
Remove type=feed and type=entry parameters from application/atom+xml media types as they make IE 6's XMLHttpRequest hang.
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@1053559 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'sca-cpp/trunk/modules/wsgi')
-rw-r--r-- | sca-cpp/trunk/modules/wsgi/atomutil.py | 6 | ||||
-rwxr-xr-x | sca-cpp/trunk/modules/wsgi/composite.py | 4 | ||||
-rw-r--r-- | sca-cpp/trunk/modules/wsgi/httputil.py | 4 |
3 files changed, 10 insertions, 4 deletions
diff --git a/sca-cpp/trunk/modules/wsgi/atomutil.py b/sca-cpp/trunk/modules/wsgi/atomutil.py index 106e69c3c6..8e812abbe9 100644 --- a/sca-cpp/trunk/modules/wsgi/atomutil.py +++ b/sca-cpp/trunk/modules/wsgi/atomutil.py @@ -54,6 +54,12 @@ def isATOMFeed(l): return False return contains(car(l), "<feed") and contains(car(l), "=\"http://www.w3.org/2005/Atom\"") +# Return true if a list of strings represents an ATOM entry +def isATOMEntry(l): + if not isXML(l): + return False + return contains(car(l), "<entry") and not contains(car(l), "<feed") and contains(car(l), "=\"http://www.w3.org/2005/Atom\"") + # Convert a list of strings to a list of values representing an ATOM feed def readATOMFeed(l): f = readXML(l) diff --git a/sca-cpp/trunk/modules/wsgi/composite.py b/sca-cpp/trunk/modules/wsgi/composite.py index ffd971fef5..9dbc2c911a 100755 --- a/sca-cpp/trunk/modules/wsgi/composite.py +++ b/sca-cpp/trunk/modules/wsgi/composite.py @@ -184,8 +184,8 @@ def application(e, r): # Write an ATOM feed or entry if isString(car(v)) and isString(cadr(v)): if isNil(id): - return result(e, r, 200, (("Content-type", "application/atom+xml;type=feed"),), writeATOMFeed(feedValuesToElements(v))) - return result(e, r, 200, (("Content-type", "application/atom+xml;type=entry"),), writeATOMEntry(entryValuesToElements(v))) + return result(e, r, 200, (("Content-type", "application/atom+xml"),), writeATOMFeed(feedValuesToElements(v))) + return result(e, r, 200, (("Content-type", "application/atom+xml"),), writeATOMEntry(entryValuesToElements(v))) # Write a JSON value return result(e, r, 200, (("Content-type", "application/json"),), writeJSON(valuesToElements(v))) diff --git a/sca-cpp/trunk/modules/wsgi/httputil.py b/sca-cpp/trunk/modules/wsgi/httputil.py index ea00f3f9fe..842460cc6a 100644 --- a/sca-cpp/trunk/modules/wsgi/httputil.py +++ b/sca-cpp/trunk/modules/wsgi/httputil.py @@ -58,13 +58,13 @@ class client: ct = res.getheader("Content-type", "text/plain") ls = (res.read(),) - if contains(ct, "application/atom+xml;type=entry"): + if atomutil.isATOMEntry(ls): # Read an ATOM entry v = atomutil.entryValue(atomutil.readATOMEntry(ls)) print >> stderr, "Client result", v return v - if contains(ct, "application/atom+xml;type=feed"): + if contains(ct, "application/atom+xml") or atomutil.isATOMFeed(ls): # Read an ATOM feed v = atomutil.feedValues(atomutil.readATOMFeed(ls)) print >> stderr, "Client result", v |