[csw-devel] SF.net SVN: gar:[21077] csw/mgar/gar/v2/lib/web/pkgdb_web.py

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Tue May 14 18:45:41 CEST 2013


Revision: 21077
          http://gar.svn.sourceforge.net/gar/?rev=21077&view=rev
Author:   wahwah
Date:     2013-05-14 16:45:41 +0000 (Tue, 14 May 2013)
Log Message:
-----------
pkgdb-web: Send content length

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/web/pkgdb_web.py

Modified: csw/mgar/gar/v2/lib/web/pkgdb_web.py
===================================================================
--- csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-05-14 16:45:30 UTC (rev 21076)
+++ csw/mgar/gar/v2/lib/web/pkgdb_web.py	2013-05-14 16:45:41 UTC (rev 21077)
@@ -313,7 +313,9 @@
     web.header('Content-type', 'application/x-vnd.opencsw.pkg;type=srv4-list')
     # We never want to return complete data for every object (too slow).
     pkgs_data = [p.GetRestRepr(quick=True)[1] for p in pkgs]
-    return cjson.encode(pkgs_data)
+    response = cjson.encode(pkgs_data)
+    web.header('Content-Length', str(len(response)))
+    return response
 
 
 class PkgnameByFilename(object):
@@ -508,7 +510,9 @@
         'pkginfo_name': cat_gen_data.pkginfo_name,
         'pkgname': cat_gen_data.pkgname,
     }
-    return cjson.encode(simple_data)
+    response = cjson.encode(simple_data)
+    web.header('Content-Length', str(len(response)))
+    return response
 
 
 class CatalogForGeneration(object):

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list