adriangjerstad / cgilib Goto Github PK
View Code? Open in Web Editor NEWAn awesome Common Gateway Interface Library for C++
License: GNU General Public License v3.0
An awesome Common Gateway Interface Library for C++
License: GNU General Public License v3.0
If the goal of this repository is to make things as simple as possible for the average CGI developer, avoid making users do the parsing.
Add the capability of users to load a template, generate a series of values for that template, populate, and send it off.
Anything like the header
class or others should not require you to have header in the name of the member.
For adding headers to a response, for example, you could use the following:
cgi::headers.add("Content-Type", "application/wasm"); // not add_header
Make it possible to send static content from another file.
Justification:
Even though you could just have the server send the raw asset, it's useful to be able to set a few headers, or send different files entirely based on the input a client offers.
Describe the solution you'd like
Create a system in which we are capable of generating input for MULTIPLE test cases in one file. This way, we have access to all of the functionality a real CGI environment would offer, just, outside of the context of a server.
Describe alternatives you've considered
There are various unit testing libraries out there, but none of them cover what would be required to do this.
Additional context
To start, we would need to clear the environment. Wipe all knowledge of environment variables from the test process. Then, get the ability to define certain metadata about the simulated request, such as request method and addresses. Offer the ability to give it HTTP headers, a request body, etc. Everything rfc3875 defines as required must be there. I'll put information on how to do these in C++ below, to get a rough idea of what is required.
When adding a new header, you receive an index to use to refer to that header. However, when you erase something from the vector, that has the chance to slide around. So if you then try to delete it, the result is some furious, fruitless debugging and some lost hair.
When the program asks for the contents of a request header, it is given the contents of an environment variable with the name equaling that header with a prefix "HTTP_".
But when multiple headers of the same type are offered in a comma separated list.
Look at RFC3875-4.1.18.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.