From 2784eb2c1515f1cdb1554d049d48b3bff0f42085 Mon Sep 17 00:00:00 2001
From: Joe Esposito <joe@joeyespo.com>
Date: Wed, 11 Oct 2023 16:34:56 -0400
Subject: [PATCH] Support Werkzeug 3 by using a default encoding of UTF-8

This fixes the removal of `charset` attribute of requests from https://github.com/pallets/werkzeug/issues/2602
introduced by Werkzeug 2.3.0 (https://werkzeug.palletsprojects.com/en/3.0.x/changes/#version-2-3-0)
---
 grip/app.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/grip/app.py b/grip/app.py
index f963e9d..16cd5f4 100644
--- a/grip/app.py
+++ b/grip/app.py
@@ -397,7 +397,7 @@ def render(self, route=None):
             route = '/'
         with self.test_client() as c:
             response = c.get(route, follow_redirects=True)
-            encoding = response.charset
+            encoding = getattr(response, 'charset', 'utf-8')
             return response.data.decode(encoding)
 
     def run(self, host=None, port=None, debug=None, use_reloader=None,
