fix(users/Profpatsch/whatcd-resolver): always use good html renderer
The pretty renderer would add extra newlines, making the html different. Change-Id: I28496cbec61d4c9c63f657a499a1990f891949ee Reviewed-on: https://cl.tvl.fyi/c/depot/+/11639 Reviewed-by: Profpatsch <mail@profpatsch.de> Tested-by: BuildkiteCI Autosubmit: Profpatsch <mail@profpatsch.de>
This commit is contained in:
		
							parent
							
								
									58156967b8
								
							
						
					
					
						commit
						15054715d6
					
				
					 1 changed files with 1 additions and 6 deletions
				
			
		|  | @ -55,7 +55,6 @@ import System.Directory qualified as Xdg | ||||||
| import System.Environment qualified as Env | import System.Environment qualified as Env | ||||||
| import System.FilePath ((</>)) | import System.FilePath ((</>)) | ||||||
| import Text.Blaze.Html (Html) | import Text.Blaze.Html (Html) | ||||||
| import Text.Blaze.Html.Renderer.Pretty qualified as Html.Pretty |  | ||||||
| import Text.Blaze.Html.Renderer.Utf8 qualified as Html | import Text.Blaze.Html.Renderer.Utf8 qualified as Html | ||||||
| import Text.Blaze.Html5 qualified as Html | import Text.Blaze.Html5 qualified as Html | ||||||
| import Tool (readTool, readTools) | import Tool (readTool, readTools) | ||||||
|  | @ -313,10 +312,6 @@ runHandlers :: | ||||||
|   (Wai.Response -> IO ResponseReceived) -> |   (Wai.Response -> IO ResponseReceived) -> | ||||||
|   m ResponseReceived |   m ResponseReceived | ||||||
| runHandlers debug defaultHandler handlers req respond = withRunInIO $ \runInIO -> do | runHandlers debug defaultHandler handlers req respond = withRunInIO $ \runInIO -> do | ||||||
|   let renderHtml = |  | ||||||
|         if debug |  | ||||||
|           then Html.Pretty.renderHtml >>> stringToText >>> textToBytesUtf8 >>> toLazyBytes |  | ||||||
|           else Html.renderHtml |  | ||||||
|   let hh route act = |   let hh route act = | ||||||
|         Otel.inSpan' |         Otel.inSpan' | ||||||
|           [fmt|Route {route}|] |           [fmt|Route {route}|] | ||||||
|  | @ -329,7 +324,7 @@ runHandlers debug defaultHandler handlers req respond = withRunInIO $ \runInIO - | ||||||
|           ) |           ) | ||||||
|           ( \span -> do |           ( \span -> do | ||||||
|               res <- act span |               res <- act span | ||||||
|               liftIO $ respond . Wai.responseLBS Http.ok200 ([("Content-Type", "text/html")] <> res.extraHeaders) . renderHtml $ res.html |               liftIO $ respond . Wai.responseLBS Http.ok200 ([("Content-Type", "text/html")] <> res.extraHeaders) . Html.renderHtml $ res.html | ||||||
|           ) |           ) | ||||||
|   let h route act = hh route (\span -> act span <&> (\html -> T2 (label @"html" html) (label @"extraHeaders" []))) |   let h route act = hh route (\span -> act span <&> (\html -> T2 (label @"html" html) (label @"extraHeaders" []))) | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue