Commit ae649664 authored by Matthew Gall's avatar Matthew Gall

Added updated configuration, and fixed worker.js

parent 226c6d35
{
"piwheels": {
"endpoint": "https://piwheels.com",
"endpoint": "https://www.piwheels.org",
"user-agent": "mirrors.wales/mirrorbot (piwheels)"
}
}
\ No newline at end of file
......@@ -60,9 +60,18 @@ async function handleRequest(request) {
})
}
return new Response(endpoint, {
headers: {
'Content-Type': 'text/plain'
// And now to perform the fetch
let lastSegment = path.substring(path.lastIndexOf('/'))
if (lastSegment.indexOf('.') === -1)
path += '/'
return fetch(`${endpoint}${path}`, {
cf: {
cacheTtlByStatus: {
"200-299": 86400,
404: 1,
"500-599": 0
}
}
})
}
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment