Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
H
HTTP.sh
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
7
Issues
7
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Laura x Dominika x Patrycja
HTTP.sh
Commits
ca2c8b4a
Commit
ca2c8b4a
authored
Jul 24, 2020
by
Dominika Liberda
💽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added basic proxying; Importing to gitlab.
parent
03f39e3d
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
0 deletions
+10
-0
src/response/proxy.sh
src/response/proxy.sh
+4
-0
src/server.sh
src/server.sh
+6
-0
No files found.
src/response/proxy.sh
0 → 100755
View file @
ca2c8b4a
printf
"HTTP/1.0 200 OK
${
cfg
[extra_headers]
}
\r\n\r\n
"
curl
${
cfg
[proxy_url]
}${
r
[url]
}
\ No newline at end of file
src/server.sh
View file @
ca2c8b4a
...
...
@@ -126,6 +126,10 @@ if [[ ${cfg[auth_required]} == true && ${r[authorized]} != true ]]; then
r[status]
=
401
fi
if
[[
${
cfg
[proxy]
}
==
true
]]
;
then
r[status]
=
211
fi
if
[[
${
r
[post]
}
==
true
&&
${
r
[status]
}
==
200
]]
;
then
# This whole ordeal is here to prevent passing binary data as a variable.
...
...
@@ -170,6 +174,8 @@ fi
if
[[
${
r
[status]
}
==
210
&&
${
cfg
[autoindex]
}
==
true
]]
;
then
source
"src/response/listing.sh"
elif
[[
${
r
[status]
}
==
211
]]
;
then
source
"src/response/proxy.sh"
elif
[[
${
r
[status]
}
==
200
]]
;
then
source
"src/response/200.sh"
elif
[[
${
r
[status]
}
==
401
]]
;
then
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment