Skip to content

Commit d72d7ee

Browse files
authored
Merge pull request #3 from kaotisk-hund/master
Proposed changes for v0.04
2 parents 46d1821 + fe31605 commit d72d7ee

File tree

3 files changed

+8
-4
lines changed

3 files changed

+8
-4
lines changed

CHANGES.txt

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1+
# v0.04: kaotisk: added some mime types
12
# v0.03: lewismc: 2021/01/21 ensure bash-httpd will run as of 2021...!
23
# bash-httpd, by Morty Abzug <[email protected]>
34
# v0.02: morty: 1998/11/22: does simple file queries
4-
# v0.01: morty: 1998/11/??: proof of concept
5+
# v0.01: morty: 1998/11/??: proof of concept

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ foo@bar:~$ git clone https://github.com/lewismc/bash-httpd.git
2121
foo@bar:~$ sudo ln -s /path/to/bash-httpd/bash-httpd-0.03.sh /usr/local/bin/bash-httpd
2222
foo@bar:~$ mkdir www // put your files in this directory
2323
```
24-
Then edit the config variables at the beginning of the script tyo suit your environment. You may need to insert a line for it in /etc/inetd.conf, running as nobody. You probably also want to wrap the port.
24+
Then edit the config variables at the beginning of the script to suit your environment. You may need to insert a line for it in /etc/inetd.conf, running as nobody. You probably also want to wrap the port.
2525

2626
If you're not root, get ahold of Netcat, preferably compile it with -DGAPING_SECURITY_HOLE (because it *is* a gaping security hole), and run:
2727
```console

bash-httpd-0.03.sh

+5-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ DEF_DIR=www
77
LOG_FACILITY=local1
88
# End of configurables
99
HTTP_VERSION="HTTP/1.0"
10-
SERVER="bash-httpd/0.02"
10+
SERVER="bash-httpd/0.04"
1111

1212
CR=`printf "\015"`
1313
program="${0##/*/}"
@@ -106,11 +106,14 @@ case $type in
106106
*.gif) mime=image/gif;;
107107
*.gz|*.tgz) mime=application/binary;;
108108
*.txt|*.text) mime=text/plain;;
109+
*.css) mime=text/css;;
110+
*.js) mime=text/javascript;;
111+
*.json) mime=application/json;;
109112
*) mime=application/binary;;
110113
esac
111114
echo Content-Type: $mime; echo; cat $file
112115
;;
113116
*)
114117
error 501 "Messed up internal type"
115118
;;
116-
esac
119+
esac

0 commit comments

Comments
 (0)