• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Python http.parse_cache_control_header函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Python中werkzeug.http.parse_cache_control_header函数的典型用法代码示例。如果您正苦于以下问题:Python parse_cache_control_header函数的具体用法?Python parse_cache_control_header怎么用?Python parse_cache_control_header使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了parse_cache_control_header函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Python代码示例。

示例1: test_static_file

 def test_static_file(self):
     app = flask.Flask(__name__)
     # default cache timeout is 12 hours
     with app.test_request_context():
         rv = app.send_static_file('index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 12 * 60 * 60)
     app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 3600
     with app.test_request_context():
         rv = app.send_static_file('index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 3600)
     # override get_send_file_options with some new values and check them
     class StaticFileApp(flask.Flask):
         def get_send_file_options(self, filename):
             opts = super(StaticFileApp, self).get_send_file_options(filename)
             opts['cache_timeout'] = 10
             # this test catches explicit inclusion of the conditional
             # keyword arg in the guts
             opts['conditional'] = True
             return opts
     app = StaticFileApp(__name__)
     with app.test_request_context():
         rv = app.send_static_file('index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 10)
开发者ID:SimonSapin,项目名称:flask,代码行数:26,代码来源:helpers.py


示例2: test_static_file

    def test_static_file(self):
        app = flask.Flask(__name__)
        # default cache timeout is 12 hours (hard-coded)
        with app.test_request_context():
            rv = app.send_static_file("index.html")
            cc = parse_cache_control_header(rv.headers["Cache-Control"])
            self.assert_equal(cc.max_age, 12 * 60 * 60)
        # override get_static_file_options with some new values and check them
        class StaticFileApp(flask.Flask):
            def __init__(self):
                super(StaticFileApp, self).__init__(__name__)

            def get_static_file_options(self, filename):
                opts = super(StaticFileApp, self).get_static_file_options(filename)
                opts["cache_timeout"] = 10
                # this test catches explicit inclusion of the conditional
                # keyword arg in the guts
                opts["conditional"] = True
                return opts

        app = StaticFileApp()
        with app.test_request_context():
            rv = app.send_static_file("index.html")
            cc = parse_cache_control_header(rv.headers["Cache-Control"])
            self.assert_equal(cc.max_age, 10)
开发者ID:dave-shawley,项目名称:flask,代码行数:25,代码来源:helpers.py


示例3: fix_headers

    def fix_headers(self, environ, headers, status=None):
        if self.fix_vary:
            header = headers.get("content-type", "")
            mimetype, options = parse_options_header(header)
            if mimetype not in ("text/html", "text/plain", "text/sgml"):
                headers.pop("vary", None)

        if self.fix_attach and "content-disposition" in headers:
            pragma = parse_set_header(headers.get("pragma", ""))
            pragma.discard("no-cache")
            header = pragma.to_header()
            if not header:
                headers.pop("pragma", "")
            else:
                headers["Pragma"] = header
            header = headers.get("cache-control", "")
            if header:
                cc = parse_cache_control_header(header, cls=ResponseCacheControl)
                cc.no_cache = None
                cc.no_store = False
                header = cc.to_header()
                if not header:
                    headers.pop("cache-control", "")
                else:
                    headers["Cache-Control"] = header
开发者ID:jrgrafton,项目名称:tweet-debate,代码行数:25,代码来源:fixers.py


示例4: fix_headers

    def fix_headers(self, environ, headers, status=None):
        if self.fix_vary:
            header = headers.get('content-type', '')
            mimetype, options = parse_options_header(header)
            if mimetype not in ('text/html', 'text/plain', 'text/sgml'):
                headers.pop('vary', None)

        if self.fix_attach and 'content-disposition' in headers:
            pragma = parse_set_header(headers.get('pragma', ''))
            pragma.discard('no-cache')
            header = pragma.to_header()
            if not header:
                headers.pop('pragma', '')
            else:
                headers['Pragma'] = header
            header = headers.get('cache-control', '')
            if header:
                cc = parse_cache_control_header(header,
                                                cls=ResponseCacheControl)
                cc.no_cache = None
                cc.no_store = False
                header = cc.to_header()
                if not header:
                    headers.pop('cache-control', '')
                else:
                    headers['Cache-Control'] = header
开发者ID:gaoussoucamara,项目名称:simens-cerpad,代码行数:26,代码来源:fixers.py


示例5: cache_control

    def cache_control(self):
        def on_update(cache_control):
            if not cache_control and "cache-control" in self.headers:
                del self.headers["cache-control"]
            elif cache_control:
                self.headers["Cache-Control"] = cache_control.to_header()

        return parse_cache_control_header(self.headers.get("cache-control"), on_update, ResponseCacheControl)
开发者ID:Reve,项目名称:eve,代码行数:8,代码来源:wrappers.py


示例6: get_cache_timeout

def get_cache_timeout(r):
    # Cache the weather data at a rate that the upstream service dictates, but
    # that also keeps us easily within the 1000 requests per day free limit.
    header = r.headers.get('Cache-Control')
    control = parse_cache_control_header(header, cls=ResponseCacheControl)
    try:
        return max(control.max_age, CACHE_MIN_SECONDS)
    except TypeError:
        return CACHE_MIN_SECONDS
开发者ID:genericmoniker,项目名称:mirror,代码行数:9,代码来源:weather.py


示例7: test_cache_control_header

    def test_cache_control_header(self):
        cc = http.parse_cache_control_header("max-age=0, no-cache")
        assert cc.max_age == 0
        assert cc.no_cache
        cc = http.parse_cache_control_header('private, community="UCI"', None, datastructures.ResponseCacheControl)
        assert cc.private
        assert cc["community"] == "UCI"

        c = datastructures.ResponseCacheControl()
        assert c.no_cache is None
        assert c.private is None
        c.no_cache = True
        assert c.no_cache == "*"
        c.private = True
        assert c.private == "*"
        del c.private
        assert c.private is None
        assert c.to_header() == "no-cache"
开发者ID:homeworkprod,项目名称:werkzeug,代码行数:18,代码来源:http.py


示例8: test_cache_control_header

    def test_cache_control_header(self):
        cc = http.parse_cache_control_header('max-age=0, no-cache')
        assert cc.max_age == 0
        assert cc.no_cache
        cc = http.parse_cache_control_header('private, community="UCI"', None,
                                             datastructures.ResponseCacheControl)
        assert cc.private
        assert cc['community'] == 'UCI'

        c = datastructures.ResponseCacheControl()
        assert c.no_cache is None
        assert c.private is None
        c.no_cache = True
        assert c.no_cache == '*'
        c.private = True
        assert c.private == '*'
        del c.private
        assert c.private is None
        assert c.to_header() == 'no-cache'
开发者ID:211sandiego,项目名称:calllog211,代码行数:19,代码来源:http.py


示例9: get_ff_cache

def get_ff_cache(profile_dir, store_body=False):
    cache_dir = os.path.join(profile_dir, "Cache")
    if not os.path.isdir(cache_dir):
        return []  # Firefox updated the cache dir structure since our study
    cache_map = os.path.join(cache_dir, "_CACHE_MAP_")
    cache_dump = os.path.join(BASE_TMP_DIR, append_timestamp("cache") +
                              rand_str())
    create_dir(cache_dump)
    subprocess.call([PERL_PATH, CACHE_PERL_SCRIPT, cache_map, "--recover=" +
                     cache_dump])
    cache_items = []
    db_items = ("Etag", "Request String", "Expires", "Cache-Control")
    for fname in glob(os.path.join(cache_dump, "*_metadata")):
        item = {}
        try:
            with open(fname) as f:
                metadata = f.read()
                item = parse_metadata(metadata)
                for db_item in db_items:
                    if db_item not in item:
                        item[db_item] = ""

                # If a response includes both an Expires header and a max-age
                # directive, the max-age directive overrides the Expires header
                # (http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html)
                expiry_delta_sec = 0
                if "Expires" in item:
                    # parse expiry date
                    expiry = parse_date(item["Expires"])
                    if expiry:
                        expiry_delta = expiry - datetime.now()
                        expiry_delta_sec = expiry_delta.total_seconds()
                if "Cache-Control:" in item:
                    # parse max-age directive
                    cache_directives =\
                        parse_cache_control_header(item["Cache-Control"],
                                                   cls=ResponseCacheControl)
                    if "max-age" in cache_directives:
                        expiry_delta_sec = cache_directives["max-age"]
                if expiry_delta_sec < DELTA_MONTH:
                    continue
                item["Expiry-Delta"] = expiry_delta_sec

            with open(fname[:-9]) as f:
                data = f.read()
                item["Body"] = data if store_body else ""  # store as BLOB
                item["Hash"] = hash_text(base64.b64encode(data))
        except IOError as exc:
            print "Error processing cache: %s: %s" % (exc,
                                                      traceback.format_exc())

        cache_items.append(item)
    if os.path.isdir(cache_dump):
        shutil.rmtree(cache_dump)
    return cache_items
开发者ID:4sp1r3,项目名称:TheWebNeverForgets,代码行数:55,代码来源:cache.py


示例10: cache_control

 def cache_control(self):
     """The Cache-Control general-header field is used to specify
     directives that MUST be obeyed by all caching mechanisms along the
     request/response chain.
     """
     def on_update(cache_control):
         if not cache_control and 'cache-control' in self.headers:
             del self.headers['cache-control']
         elif cache_control:
             self.headers['Cache-Control'] = cache_control.to_header()
     return parse_cache_control_header(self.headers.get('cache-control'),
                                       on_update)
开发者ID:danaspiegel,项目名称:softball_stat_manager,代码行数:12,代码来源:wrappers.py


示例11: testStaticFile

    def testStaticFile(self):
        ConfigManager.removeConfig('development')
        ConfigManager.addConfig(testConfig)
        app = shimehari.Shimehari(__name__)
        app.setStaticFolder('static')
        with app.testRequestContext():
            rv = app.sendStaticFile('index.html')
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assertEqual(cc.max_age, 12 * 60 * 60)
            rv = shimehari.sendFile(os.path.join(app.rootPath, 'static/index.html'))
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assertEqual(cc.max_age, 12 * 60 * 60)
        app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 3600
        with app.testRequestContext():
            rv = app.sendStaticFile('index.html')
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assertEqual(cc.max_age, 3600)
            rv = shimehari.sendFile(os.path.join(app.rootPath, 'static/index.html'))
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assertEqual(cc.max_age, 3600)

        class StaticFileApp(shimehari.Shimehari):
            def getSendFileMaxAge(self, filename):
                return 10
        app = StaticFileApp(__name__)
        app.setStaticFolder('static')
        with app.testRequestContext():
            rv = app.sendStaticFile('index.html')
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assertEqual(cc.max_age, 10)
            rv = shimehari.sendFile(os.path.join(app.rootPath, 'static/index.html'))
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assertEqual(cc.max_age, 10)
开发者ID:glassesfactory,项目名称:Shimehari,代码行数:33,代码来源:test_helpers.py


示例12: test_static_file

 def test_static_file(self):
     app = flask.Flask(__name__)
     # default cache timeout is 12 hours
     with app.test_request_context():
         # Test with static file handler.
         rv = app.send_static_file('index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 12 * 60 * 60)
         # Test again with direct use of send_file utility.
         rv = flask.send_file('static/index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 12 * 60 * 60)
     app.config['SEND_FILE_MAX_AGE_DEFAULT'] = 3600
     with app.test_request_context():
         # Test with static file handler.
         rv = app.send_static_file('index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 3600)
         # Test again with direct use of send_file utility.
         rv = flask.send_file('static/index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 3600)
     class StaticFileApp(flask.Flask):
         def get_send_file_max_age(self, filename):
             return 10
     app = StaticFileApp(__name__)
     with app.test_request_context():
         # Test with static file handler.
         rv = app.send_static_file('index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 10)
         # Test again with direct use of send_file utility.
         rv = flask.send_file('static/index.html')
         cc = parse_cache_control_header(rv.headers['Cache-Control'])
         self.assert_equal(cc.max_age, 10)
开发者ID:JeffSpies,项目名称:flask,代码行数:35,代码来源:helpers.py


示例13: _get_cache_control_directive

 def _get_cache_control_directive(self, name):
     success, the_values = self._enumerate_header("cache-control")
     if success:
         cc = parse_cache_control_header(the_values,
                                         cls=ResponseCacheControl)
         if name == "max-age" and cc.max_age is not None:
             return True, timedelta(seconds=int(cc.max_age))
         elif name == "stale-while-revalidate" and \
                 cc.stale_while_revalidate is not None:
             return True, timedelta(seconds=int(cc.stale_while_revalidate))
         else:
             return False, None
     else:
         return False, None
开发者ID:ahlfors,项目名称:http_cache_control_analyser,代码行数:14,代码来源:http_response_headers.py


示例14: test_templates_and_static

    def test_templates_and_static(self):
        from blueprintapp import app

        c = app.test_client()

        rv = c.get('/')
        self.assert_equal(rv.data, b'Hello from the Frontend')
        rv = c.get('/admin/')
        self.assert_equal(rv.data, b'Hello from the Admin')
        rv = c.get('/admin/index2')
        self.assert_equal(rv.data, b'Hello from the Admin')
        rv = c.get('/admin/static/test.txt')
        self.assert_equal(rv.data.strip(), b'Admin File')
        rv.close()
        rv = c.get('/admin/static/css/test.css')
        self.assert_equal(rv.data.strip(), b'/* nested file */')
        rv.close()

        # try/finally, in case other tests use this app for Blueprint tests.
        max_age_default = app.config['SEND_FILE_MAX_AGE_DEFAULT']
        try:
            expected_max_age = 3600
            if app.config['SEND_FILE_MAX_AGE_DEFAULT'] == expected_max_age:
                expected_max_age = 7200
            app.config['SEND_FILE_MAX_AGE_DEFAULT'] = expected_max_age
            rv = c.get('/admin/static/css/test.css')
            cc = parse_cache_control_header(rv.headers['Cache-Control'])
            self.assert_equal(cc.max_age, expected_max_age)
            rv.close()
        finally:
            app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default

        with app.test_request_context():
            self.assert_equal(flask.url_for('admin.static', filename='test.txt'),
                              '/admin/static/test.txt')

        with app.test_request_context():
            try:
                flask.render_template('missing.html')
            except TemplateNotFound as e:
                self.assert_equal(e.name, 'missing.html')
            else:
                self.assert_true(0, 'expected exception')

        with flask.Flask(__name__).test_request_context():
            self.assert_equal(flask.render_template('nested/nested.txt'), 'I\'m nested')
开发者ID:dvska,项目名称:flask,代码行数:46,代码来源:blueprints.py


示例15: surrogate_control

 def surrogate_control(self):
     """
     The Cache-Control general-header field is used to specify
     directives that MUST be obeyed by all caching mechanisms along the
     request/response chain.
     """
     def on_update(surrogate_control):
         if not surrogate_control and "surrogate-control" in self.headers:
             del self.headers["surrogate-control"]
         elif surrogate_control:  # pragma: no cover
             self.headers["Surrogate-Control"] = \
                 surrogate_control.to_header()
     return parse_cache_control_header(
         self.headers.get("surrogate-control"),
         on_update,
         ResponseCacheControl,
     )
开发者ID:AaronLaw,项目名称:warehouse,代码行数:17,代码来源:http.py


示例16: test_static_file

    def test_static_file(self, app, req_ctx):
        # default cache timeout is 12 hours

        # Test with static file handler.
        rv = app.send_static_file("index.html")
        cc = parse_cache_control_header(rv.headers["Cache-Control"])
        assert cc.max_age == 12 * 60 * 60
        rv.close()
        # Test again with direct use of send_file utility.
        rv = flask.send_file("static/index.html")
        cc = parse_cache_control_header(rv.headers["Cache-Control"])
        assert cc.max_age == 12 * 60 * 60
        rv.close()
        app.config["SEND_FILE_MAX_AGE_DEFAULT"] = 3600

        # Test with static file handler.
        rv = app.send_static_file("index.html")
        cc = parse_cache_control_header(rv.headers["Cache-Control"])
        assert cc.max_age == 3600
        rv.close()
        # Test again with direct use of send_file utility.
        rv = flask.send_file("static/index.html")
        cc = parse_cache_control_header(rv.headers["Cache-Control"])
        assert cc.max_age == 3600
        rv.close()

        # Test with static file handler.
        rv = app.send_static_file(FakePath("index.html"))
        cc = parse_cache_control_header(rv.headers["Cache-Control"])
        assert cc.max_age == 3600
        rv.close()

        class StaticFileApp(flask.Flask):
            def get_send_file_max_age(self, filename):
                return 10

        app = StaticFileApp(__name__)
        with app.test_request_context():
            # Test with static file handler.
            rv = app.send_static_file("index.html")
            cc = parse_cache_control_header(rv.headers["Cache-Control"])
            assert cc.max_age == 10
            rv.close()
            # Test again with direct use of send_file utility.
            rv = flask.send_file("static/index.html")
            cc = parse_cache_control_header(rv.headers["Cache-Control"])
            assert cc.max_age == 10
            rv.close()
开发者ID:Warkanlock,项目名称:flask,代码行数:48,代码来源:test_helpers.py


示例17: test_templates_and_static

def test_templates_and_static(test_apps):
    from blueprintapp import app

    client = app.test_client()

    rv = client.get("/")
    assert rv.data == b"Hello from the Frontend"
    rv = client.get("/admin/")
    assert rv.data == b"Hello from the Admin"
    rv = client.get("/admin/index2")
    assert rv.data == b"Hello from the Admin"
    rv = client.get("/admin/static/test.txt")
    assert rv.data.strip() == b"Admin File"
    rv.close()
    rv = client.get("/admin/static/css/test.css")
    assert rv.data.strip() == b"/* nested file */"
    rv.close()

    # try/finally, in case other tests use this app for Blueprint tests.
    max_age_default = app.config["SEND_FILE_MAX_AGE_DEFAULT"]
    try:
        expected_max_age = 3600
        if app.config["SEND_FILE_MAX_AGE_DEFAULT"] == expected_max_age:
            expected_max_age = 7200
        app.config["SEND_FILE_MAX_AGE_DEFAULT"] = expected_max_age
        rv = client.get("/admin/static/css/test.css")
        cc = parse_cache_control_header(rv.headers["Cache-Control"])
        assert cc.max_age == expected_max_age
        rv.close()
    finally:
        app.config["SEND_FILE_MAX_AGE_DEFAULT"] = max_age_default

    with app.test_request_context():
        assert (
            flask.url_for("admin.static", filename="test.txt")
            == "/admin/static/test.txt"
        )

    with app.test_request_context():
        with pytest.raises(TemplateNotFound) as e:
            flask.render_template("missing.html")
        assert e.value.name == "missing.html"

    with flask.Flask(__name__).test_request_context():
        assert flask.render_template("nested/nested.txt") == "I'm nested"
开发者ID:Warkanlock,项目名称:flask,代码行数:45,代码来源:test_blueprints.py


示例18: test_templates_and_static

def test_templates_and_static(test_apps):
    from blueprintapp import app
    c = app.test_client()

    rv = c.get('/')
    assert rv.data == b'Hello from the Frontend'
    rv = c.get('/admin/')
    assert rv.data == b'Hello from the Admin'
    rv = c.get('/admin/index2')
    assert rv.data == b'Hello from the Admin'
    rv = c.get('/admin/static/test.txt')
    assert rv.data.strip() == b'Admin File'
    rv.close()
    rv = c.get('/admin/static/css/test.css')
    assert rv.data.strip() == b'/* nested file */'
    rv.close()

    # try/finally, in case other tests use this app for Blueprint tests.
    max_age_default = app.config['SEND_FILE_MAX_AGE_DEFAULT']
    try:
        expected_max_age = 3600
        if app.config['SEND_FILE_MAX_AGE_DEFAULT'] == expected_max_age:
            expected_max_age = 7200
        app.config['SEND_FILE_MAX_AGE_DEFAULT'] = expected_max_age
        rv = c.get('/admin/static/css/test.css')
        cc = parse_cache_control_header(rv.headers['Cache-Control'])
        assert cc.max_age == expected_max_age
        rv.close()
    finally:
        app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default

    with app.test_request_context():
        assert keyes.url_for('admin.static', filename='test.txt') == '/admin/static/test.txt'

    with app.test_request_context():
        with pytest.raises(TemplateNotFound) as e:
            keyes.render_template('missing.html')
        assert e.value.name == 'missing.html'

    with keyes.Keyes(__name__).test_request_context():
        assert keyes.render_template('nested/nested.txt') == 'I\'m nested'
开发者ID:KinSai1975,项目名称:Keyes.py,代码行数:41,代码来源:test_blueprints.py


示例19: test_default_static_cache_timeout

    def test_default_static_cache_timeout(self):
        app = flask.Flask(__name__)
        class MyBlueprint(flask.Blueprint):
            def get_send_file_max_age(self, filename):
                return 100

        blueprint = MyBlueprint('blueprint', __name__, static_folder='static')
        app.register_blueprint(blueprint)

        # try/finally, in case other tests use this app for Blueprint tests.
        max_age_default = app.config['SEND_FILE_MAX_AGE_DEFAULT']
        try:
            with app.test_request_context():
                unexpected_max_age = 3600
                if app.config['SEND_FILE_MAX_AGE_DEFAULT'] == unexpected_max_age:
                    unexpected_max_age = 7200
                app.config['SEND_FILE_MAX_AGE_DEFAULT'] = unexpected_max_age
                rv = blueprint.send_static_file('index.html')
                cc = parse_cache_control_header(rv.headers['Cache-Control'])
                self.assert_equal(cc.max_age, 100)
        finally:
            app.config['SEND_FILE_MAX_AGE_DEFAULT'] = max_age_default
开发者ID:0xJCG,项目名称:dubtrack-technical-test,代码行数:22,代码来源:blueprints.py


示例20: test_default_static_cache_timeout

def test_default_static_cache_timeout(app):
    class MyBlueprint(flask.Blueprint):
        def get_send_file_max_age(self, filename):
            return 100

    blueprint = MyBlueprint("blueprint", __name__, static_folder="static")
    app.register_blueprint(blueprint)

    # try/finally, in case other tests use this app for Blueprint tests.
    max_age_default = app.config["SEND_FILE_MAX_AGE_DEFAULT"]
    try:
        with app.test_request_context():
            unexpected_max_age = 3600
            if app.config["SEND_FILE_MAX_AGE_DEFAULT"] == unexpected_max_age:
                unexpected_max_age = 7200
            app.config["SEND_FILE_MAX_AGE_DEFAULT"] = unexpected_max_age
            rv = blueprint.send_static_file("index.html")
            cc = parse_cache_control_header(rv.headers["Cache-Control"])
            assert cc.max_age == 100
            rv.close()
    finally:
        app.config["SEND_FILE_MAX_AGE_DEFAULT"] = max_age_default
开发者ID:Warkanlock,项目名称:flask,代码行数:22,代码来源:test_blueprints.py



注:本文中的werkzeug.http.parse_cache_control_header函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Python http.parse_cookie函数代码示例发布时间:2022-05-26
下一篇:
Python http.parse_authorization_header函数代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap