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
c02cf1b2
Commit
c02cf1b2
authored
Jan 15, 2021
by
Dominika Liberda
💽
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
* fixed bugs in session_get_username() and the cookie handler
parent
fe02fa38
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
6 deletions
+7
-6
config/master.sh
config/master.sh
+2
-2
src/account.sh
src/account.sh
+1
-1
src/server.sh
src/server.sh
+4
-3
No files found.
config/master.sh
View file @
c02cf1b2
declare
-A
cfg
cfg[ip]
=
127.0.0.1
# IP address to bind to - use 0.0.0.0 to bind to all
cfg[ip]
=
0.0.0.0
# IP address to bind to - use 0.0.0.0 to bind to all
cfg[http]
=
true
# enables/disables listening on HTTP
cfg[port]
=
13
37
# HTTP port
cfg[port]
=
13
41
# HTTP port
cfg[namespace]
=
'app'
...
...
src/account.sh
View file @
c02cf1b2
...
...
@@ -74,7 +74,7 @@ function session_get_username() {
[[
"
$1
"
==
""
]]
&&
return
IFS
=
':'
local
data
=(
$(
grep
":
$1
"
secret/users.dat
)
)
local
data
=(
$(
grep
":
$1
$
"
secret/users.dat
)
)
unset
IFS
echo
${
data
[0]
}
}
...
...
src/server.sh
View file @
c02cf1b2
...
...
@@ -54,9 +54,10 @@ while read param; do
r[authorization]
=
"
$(
printf
"
$param
"
|
sed
's/Authorization: Bearer //;s/\r//'
)
"
elif
[[
"
$param
"
==
*
"Cookie: "
*
]]
;
then
for
i
in
$(
echo
$param
|
sed
-E
's/Cookie: //;s/\;//g;s/%/\\x/g'
)
;
do
name
=
"
$(
echo
$i
|
sed
-E
's/\=(.*)$//'
)
"
value
=
"
$(
echo
$i
|
sed
-E
's/^(.*)\=//'
)
"
IFS
=
';'
for
i
in
$(
IFS
=
' '
;
echo
"
$param
"
|
sed
-E
's/Cookie: //;;s/%/\\x/g'
)
;
do
name
=
"
$((
grep
-
Poh
".*?(?==)"
|
head
-
1
)
<<<
$i
)
"
value="
$(
sed
"s/
$name
=//"
<<<
$i
)
"
cookies[
$name
]="
$(
echo
-e
$value
)
"
done
...
...
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