Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
A
avatar-helper
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
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
MyCard
avatar-helper
Commits
e54c2121
Commit
e54c2121
authored
Oct 20, 2019
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
encode
parent
00473241
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
index.js
index.js
+3
-3
No files found.
index.js
View file @
e54c2121
...
...
@@ -17,7 +17,7 @@ const https_server = https.createServer(https_options, (request, response) => {
response
.
end
(
"
Invalid pathname.
"
);
return
;
}
const
username
=
path_match
[
1
]
;
const
username
=
encodeURIComponent
(
path_match
[
1
])
;
console
.
log
(
"
REQUEST
"
,
username
);
_request
({
url
:
"
https://ygobbs.com/users/
"
+
username
+
"
.json
"
,
...
...
@@ -35,7 +35,7 @@ const https_server = https.createServer(https_options, (request, response) => {
console
.
log
(
"
FALLBACK
"
,
username
);
request_avatar
(
response
,
username
);
}
else
{
const
real_username
=
body
.
users
[
0
].
username
;
const
real_username
=
encodeURIComponent
(
body
.
users
[
0
].
username
)
;
request_avatar
(
response
,
real_username
);
}
});
...
...
@@ -43,7 +43,7 @@ const https_server = https.createServer(https_options, (request, response) => {
function
request_avatar
(
response
,
username
)
{
_request
({
url
:
"
https://api.moecube.com/accounts/users/
"
+
encodeURIComponent
(
username
)
+
"
.avatar
"
url
:
"
https://api.moecube.com/accounts/users/
"
+
username
+
"
.avatar
"
},
(
error
,
res
,
body
)
=>
{
if
(
error
)
{
response
.
writeHead
(
500
);
...
...
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