Commit 37640816 authored by Romain Courteaud's avatar Romain Courteaud

erp5_web_renderjs_ui: browser send GMT suffix

parent a8703635
from DateTime import DateTime
if REQUEST is None: if REQUEST is None:
REQUEST = context.REQUEST REQUEST = context.REQUEST
if response is None: if response is None:
...@@ -11,12 +13,14 @@ response.setHeader("Access-Control-Allow-Origin", "*") ...@@ -11,12 +13,14 @@ response.setHeader("Access-Control-Allow-Origin", "*")
web_page = context web_page = context
web_section = context.getWebSectionValue() web_section = context.getWebSectionValue()
# Must-Revalidate caching policy uses Base_getWebSiteDrivenModificationDate
modification_date_string = web_page.Base_getWebSiteDrivenModificationDate().rfc822() modification_date_string = web_page.Base_getWebSiteDrivenModificationDate().rfc822()
# Must-Revalidate caching policy uses Base_getWebSiteDrivenModificationDate modified_since = REQUEST.getHeader('If-Modified-Since', '')
if REQUEST.getHeader('If-Modified-Since', '') == modification_date_string: if modified_since:
response.setStatus(304) if DateTime(modified_since).rfc822() == modification_date_string:
return "" response.setStatus(304)
return ""
portal_type = web_page.getPortalType() portal_type = web_page.getPortalType()
web_content = web_page.getTextContent() web_content = web_page.getTextContent()
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment