Skip to content

Instantly share code, notes, and snippets.

Avatar

Daniel Brall Bradan

View GitHub Profile
View control.js
function init() {
fetch("fetch.xml").then(r => r.text()).then(t => console.log(t));
}
window.addEventListener("load", init);
@Bradan
Bradan / test_server.py
Created Aug 14, 2020
Problem with CORS and fetch on same origin. Browser assumes the "same-origin" to be null, but why?
View test_server.py
#!/usr/bin/env python3
from http.server import HTTPServer, HTTPStatus, SimpleHTTPRequestHandler, test
import sys
from urllib.parse import urlparse
import os
class TestRequestHandler (SimpleHTTPRequestHandler):
def do_GET(self):
"""Serve a GET request."""
You can’t perform that action at this time.