File tree Expand file tree Collapse file tree 2 files changed +14
-2
lines changed
examples/file-upload/pages Expand file tree Collapse file tree 2 files changed +14
-2
lines changed Original file line number Diff line number Diff line change 183183 BOUNDARY=" ${BOUNDARY#* =} "
184184 fi
185185
186-
187186 # Read cookies (yum!)
188187 if [[ ! -z " ${HTTP_HEADERS["Cookie"]} " ]]; then
189188 while read -r -d ' ;' line; do
197196
198197 # Read multipart body
199198 if [[ ! -z " $BOUNDARY " ]]; then
199+ route_script=` matchRoute " $REQUEST_PATH " `
200+ ALLOW_UPLOADS=false
201+ if directive_test=$( head -1 " pages/${route_script} " ) ; then
202+ if [[ " $directive_test " == " # allow-uploads" ]]; then
203+ ALLOW_UPLOADS=true
204+ fi
205+ fi
206+ if [[ " $ALLOW_UPLOADS " != " true" ]]; then
207+ printf " %s\r\n" " HTTP/1.1 403 Forbidden"
208+ printf " %s\r\n" " Server: bash lol"
209+ printf " %s\r\n" " "
210+ return
211+ fi
200212 state=" start"
201213 reader=" reading"
202214 local -A MULTIPART_HEADERS
Original file line number Diff line number Diff line change 1+ # allow-uploads
12
2- debug " hello"
33echo " <pre>"
44printf " %s\n" " ${FILE_UPLOADS[@]@ K} "
55printf " %s\n" " ${FILE_UPLOAD_NAMES[@]@ K} "
You can’t perform that action at this time.
0 commit comments