Comments (2)
Sorry that it took a while to respond, but I really wanted to test this and could not finish before Christmas vacation.
I got me an Ubuntu 18.04.4 LTS and tested your code, but find the issue with the current head version of civetweb.
I can read the code from all three scripts.
In all 3 cases the response has exactly one byte more from the *.lp file as compared to directly loading the file.
This additional byte is the newline from the *.lp file
If this newline is removed, the result is identical.
from civetweb.
Thank you very much for the response.
The issue you described does exist and can be easily addressed by removing a trailing whitespace from the LUA page body in mod_lua.inl:run_lsp_civetweb() and its "kepler" counterpart.
Unfortunately, the root of my problem (solved) is somewhere else. My instance of civetweb was built with ZLIB/COMPRESSION enabled, so all outgoing files larger than 1K were supposed to be automatically compressed when sent to a capable HTTP client, i.e. the one which provides the 'Accept-Encoding: gzip' header with its HTTP Get command.
All three Web browsers (Chrome, Firefox, Edge) that I've tried always define this header, but the 'curl' utility doesn't do this by default.
This is why I was getting different results while using different methods of testing: 'curl' seemed to work on large files, but the same content looked totally garbled when received by the web browser.
For my use case I simply decided to never enable the 'WITH_ZLIB' civetweb build option.
Thanks again!
from civetweb.
Related Issues (20)
- Why are the test examples in .xhtml? HOT 1
- Are there recommended ways to get OpenSSL support for Android? HOT 4
- CodeQL not working HOT 1
- Manual did not mention preparations for OpenSSL support?
- example client showing unrecognized chars in "Content" HOT 1
- Integer overflow (leading to stack-based buffer overflow) in embedded lua_struct.c HOT 7
- Here is a negation overflow in lua HOT 5
- Can't get index.lua file working on Linux. HOT 2
- mg.redirect and mg.send_http_redirect fall in an infinite loop
- strtod() in civetweb 1.16. HOT 5
- mg_set_request_handler callback function is hit after 10-20seconds of receiving the http get request HOT 1
- Crash in function mg_handle_form_request() when receiving badly formed form data post. HOT 3
- Array overrun is possible. The '1' index is pointing beyond array bound. HOT 2
- At least ws_server.c contains code, which is not supported on Android > NDK 23 HOT 5
- Feature request: Allow the specification of multiple directories for fallback_document_root HOT 3
- When I refreshed the web page, a segmentation fault occurred in the program. HOT 1
- Calling the correct handler for uri HOT 1
- Missing mg_start2.md document
- socket memory buffer HOT 1
- how to remove the header and footer while using mg_read HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from civetweb.