Skip to content

Commit

Permalink
sync between repos
Browse files Browse the repository at this point in the history
  • Loading branch information
pierreaubert committed Mar 15, 2024
1 parent f59a2e6 commit da21557
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
10 changes: 9 additions & 1 deletion debug_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,18 @@
class CORSRequestHandler(SimpleHTTPRequestHandler):
"""Generate CORS headers"""

def do_GET(self):
f = self.send_head()
if f:
try:
self.copyfile(f, self.wfile)
finally:
f.close()

def end_headers(self):
self.send_header("Access-Control-Allow-Origin", "*")
self.send_header("Access-Control-Allow-Methods", "GET")
self.send_header("Cache-Control", "no-store, no-cache, must-revalidate")
# self.send_header("Cache-Control", "no-store, no-cache, must-revalidate")
return super(CORSRequestHandler, self).end_headers()


Expand Down
4 changes: 2 additions & 2 deletions src/website/assets/common.js
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ export function getSpeakerData(metaSpeakers, graph, speaker, origin, version) {

const url = getSpeakerUrl(metaSpeakers, graph, speaker, origin, version);
// console.log('fetching url=' + url)
const spec = fetch(url)
const spec = fetch(url, { headers: { 'Accept-Encoding': 'bz2, gzip, deflate', 'Content-Type': 'application/json' } })
.then((response) => response.json())
.catch((error) => {
console.log('ERROR getSpeaker failed for ' + url + 'with error: ' + error);
Expand All @@ -186,7 +186,7 @@ export function getAllSpeakers(table) {
}

function fetchDataAndMap(url, encoding) {
console.log('fetching url=' + url + ' encoding=' + encoding);
// console.log('fetching url=' + url + ' encoding=' + encoding);
const spec = fetch(url, { headers: { 'Accept-Encoding': encoding, 'Content-Type': 'application/json' } })
.catch((error) => {
console.log('ERROR getMetadata for ' + url + ' yield a 404 with error: ' + error);
Expand Down
2 changes: 2 additions & 0 deletions src/website/assets/search.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,10 @@ getMetadata()
const sortOrder = url.searchParams.get('reverse');
if (sortOrder === 'true') {
sorter.reverse = true;
document.querySelector('#sortReverse').checked = true;
} else {
sorter.reverse = false;
document.querySelector('#sortReverse').checked = false;
}
} else {
sorter.reverse = false;
Expand Down

0 comments on commit da21557

Please sign in to comment.