Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Michał "rysiek" Woźniak
samizdat
Commits
e4ae9157
Commit
e4ae9157
authored
Oct 05, 2020
by
Michał "rysiek" Woźniak
🔒
Browse files
WIP
#71
: fetch now uses self.log
parent
51a2c2f1
Changes
1
Hide whitespace changes
Inline
Side-by-side
plugins/fetch.js
View file @
e4ae9157
...
...
@@ -26,7 +26,7 @@
* getting content using regular HTTP(S) fetch()
*/
let
fetchContent
=
(
url
)
=>
{
console
.
log
(
'
Samizdat:
regular fetch
!
'
)
self
.
log
(
config
.
name
,
`
regular fetch
:
${
url
}
`
)
return
fetch
(
url
,
{
cache
:
"
reload
"
})
.
then
((
response
)
=>
{
// 4xx? 5xx? that's a paddlin'
...
...
@@ -35,7 +35,7 @@
throw
new
Error
(
'
HTTP Error:
'
+
response
.
status
+
'
'
+
response
.
statusText
);
}
// all good, it seems
console
.
log
(
"
(COMMIT_UNKNOWN) Fetched:
"
,
response
.
url
);
self
.
log
(
config
.
name
,
`fetched successfully:
${
response
.
url
}
`
);
// we need to create a new Response object
// with all the headers added explicitly,
...
...
Write
Preview
Supports
Markdown
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