busybox httpd: how to get http header from CGI

Tim Tassonis stuff at decentral.ch
Wed Jul 3 15:30:44 UTC 2019


On 7/3/19 3:07 PM, nick83ola wrote:
> Hi all,
> there's a way for a cgi script to get the HTTP header of the request?
> in particular I get a jwt token into the request and i want to be able
> to validate it

most http headers are stored as environment variables starting with 
HTTP_ for the script (except the authentication header, for securitry 
reasons).

So, it's best to dumo the environment in your script to the screen or to 
a file first and then have a look what's around and how it is  named.


A simple test shell script would be:


#!/bin/sh
printf "Content-type: text/plain\n\n"
set
exit 0




Bye
Tim


More information about the busybox mailing list