From d57aa6e7c0cbcff184c3eeaf09c85f607b74021f Mon Sep 17 00:00:00 2001 From: Sam Habiel Date: Mon, 25 Jul 2022 16:59:46 -0400 Subject: [PATCH] [#59] Zipping .woff2 returns incorrect data to the web browser/client It turns out that the code to write out a binary file after it was read was missing `set $x=0`, otherwise GT.M/YottaDB by default will add a LF to the file at the end. This caused the following steps of gzipping the binary file to effectively fail. No tests, as I can't think of an easy test to test this within the framework used in the Web Server. Version bumped to 1.1.4. --- doc/INSTALL.md | 6 +++--- src/_webrsp.m | 1 + src/webinit.m | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/doc/INSTALL.md b/doc/INSTALL.md index 7c68912..859d1f2 100644 --- a/doc/INSTALL.md +++ b/doc/INSTALL.md @@ -57,7 +57,7 @@ in your shell. If you see anything other than a blank, you are ready to go. On the linux terminal, Use cURL to download the bootstrap routine. - curl -L https://github.com/shabiel/M-Web-Server/releases/download/1.1.3/webinit.rsa > /tmp/webinit.rsa + curl -L https://github.com/shabiel/M-Web-Server/releases/download/1.1.4/webinit.rsa > /tmp/webinit.rsa Run GT.M/YottaDB using `$gtm_dist/mumps -dir` or `$ydb_dist/yottadb -dir`. @@ -176,7 +176,7 @@ Then download the bootstrap file as follows: C:\Users\VISTAEXPERTISE>cd %temp% - C:\Users\VISTAE~1\AppData\Local\Temp>curl -k -L -O https://github.com/shabiel/M-Web-Server/releases/download/1.1.3/webinit.rsa + C:\Users\VISTAE~1\AppData\Local\Temp>curl -k -L -O https://github.com/shabiel/M-Web-Server/releases/download/1.1.4/webinit.rsa Open the Cache Terminal from the Cache Cube, or use another method to get in. Read the routine archive in. Cache will complain that it doesn't recoginze GT.M's format. Ignore this error. @@ -265,7 +265,7 @@ Open the Linux Terminal. Use cURL to download the bootstrap routine. - curl -L https://github.com/shabiel/M-Web-Server/releases/download/1.1.3/webinit.rsa > /tmp/webinit.rsa + curl -L https://github.com/shabiel/M-Web-Server/releases/download/1.1.4/webinit.rsa > /tmp/webinit.rsa Open the Cache Terminal using `csession CACHE`, and switch to the appropriate namespace. diff --git a/src/_webrsp.m b/src/_webrsp.m index 72f4352..8134401 100644 --- a/src/_webrsp.m +++ b/src/_webrsp.m @@ -345,6 +345,7 @@ D W("Content-Length: "_SIZE_$C(13,10)_$C(13,10)) . I $D(@HTTPRSP)>1 S I=0 F S I=$O(@HTTPRSP@(I)) Q:'I W @HTTPRSP@(I) ; ; Close + s $x=0 ; needed to prevent adding an EOF to the file c file ; O "D":(shell="/bin/sh":command="gzip "_file:parse):0:"pipe" diff --git a/src/webinit.m b/src/webinit.m index d7b6b37..11f8dc0 100644 --- a/src/webinit.m +++ b/src/webinit.m @@ -1,5 +1,5 @@ webinit ; OSE/SMH - Initialize Web Server;2019-11-14 2:36 PM - ;;1.1.3;MASH WEB SERVER/WEB SERVICES + ;;1.1.4;MASH WEB SERVER/WEB SERVICES ; ; Map %web on Cache DO CACHEMAP("%web")