Code Monkey home page Code Monkey logo

Comments (2)

bel2125 avatar bel2125 commented on June 10, 2024

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.

image

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

image

If this newline is removed, the result is identical.

from civetweb.

h1uke avatar h1uke commented on June 10, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.