Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
S
SteamOS Devkit Service
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
devkit
SteamOS Devkit Service
Commits
eb34a9c3
Commit
eb34a9c3
authored
3 years ago
by
Jeremy Whiting
Browse files
Options
Downloads
Patches
Plain Diff
Return 404 on unknown get request.
Also change writefile to write_file.
parent
20515ceb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!1
Rewrite devkit service in python.
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/steamos-devkit-service.py
+4
-4
4 additions, 4 deletions
src/steamos-devkit-service.py
with
4 additions
and
4 deletions
src/steamos-devkit-service.py
+
4
−
4
View file @
eb34a9c3
...
...
@@ -56,7 +56,7 @@ HOOK_DIRS = []
USE_DEFAULT_HOOKS
=
True
def
writefile
(
data
:
bytes
)
->
str
:
def
write
_
file
(
data
:
bytes
)
->
str
:
"""
Write given bytes to a temporary file and return the filename
Return the empty string if unable to open temp file for some reason
...
...
@@ -140,7 +140,7 @@ def write_key(post_body: bytes) -> str:
# write data to the file
data
=
body_decoded
[:
length
]
filename
=
writefile
(
data
.
encode
())
filename
=
write
_
file
(
data
.
encode
())
if
filename
:
print
(
f
"
Filename key written to:
{
filename
}
"
)
...
...
@@ -246,8 +246,8 @@ class DevkitHandler(BaseHTTPRequestHandler):
self
.
_send_headers
(
404
,
""
)
return
self
.
_send_headers
(
200
,
"
text/html
"
)
self
.
wfile
.
write
(
"
Get works
\n
"
.
encode
())
self
.
_send_headers
(
404
,
"
"
)
self
.
wfile
.
write
(
"
Unknown request
\n
"
.
encode
())
def
do_POST
(
self
):
"""
Handle POST requests
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment