1
0
Fork 0
mirror of https://gitlab.com/niansa/simpsh-httpd.git synced 2025-03-06 20:53:36 +01:00

Add files via upload

This commit is contained in:
niansa 2017-03-09 12:48:01 +01:00 committed by GitHub
parent 8d915494f4
commit b9228a0105
2 changed files with 3 additions and 4 deletions

View file

@ -1,10 +1,9 @@
#! /bin/bash #! /bin/bash
# Lese den request # Lese den request
read $header read header
# Verarbeite den request # Verarbeite den request
URL="${header#GET }" URL="${header#GET }"
URL="${URL% HTTP/*}" URL="${URL% HTTP/*}"
export FILE="$FILES$URL" export FILE="$FILES$URL"
echo $URL

View file

@ -1,13 +1,13 @@
#! /bin/bash #! /bin/bash
# Blockiere Versuche, das restliche Dateisystem zu lesen # Blockiere Versuche, das restliche Dateisystem zu lesen
if [ "$URL" = "*..*" ]; then if [[ "$URL" == *..* ]]; then
export URL='/' export URL='/'
export FILE="$FILES" export FILE="$FILES"
fi fi
# Verhindere "/"-bug # Verhindere "/"-bug
if [ -d "$FILE" -a "$FILE" != "*/" ]; then if [ -d "$FILE" ]; then
newURL="$URL"'/' newURL="$URL"'/'
export URL="$newURL" export URL="$newURL"
newFILE="$FILE"'/' newFILE="$FILE"'/'