Compare commits

...

2 Commits

Author SHA1 Message Date
nemunaire 45aef0b637 Disallow indexing 2022-08-15 10:12:36 +02:00
nemunaire f17dac8542 Allow CORS request 2022-08-15 09:41:44 +02:00
1 changed files with 3 additions and 0 deletions

View File

@ -30,6 +30,7 @@ func Serve(w http.ResponseWriter, r *http.Request) {
<head>
<title>` + title + `</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="noindex, nofollow">
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css" integrity="sha384-HSMxcRTRxnN+Bdg0JdbxYKrThecOKuH5zCYotlSAcp1+c8xmyTe9GYg1l9a69psu" crossorigin="anonymous">
<style>.table > tbody > tr > th, .table > tbody > tr > td { vertical-align: middle; }
td.danger { text-align: center; }
@ -196,6 +197,8 @@ func ServeJSONStudent(w http.ResponseWriter, r *http.Request) {
log.Printf("Handling %s request from %s: %s [%s]\n", r.Method, r.RemoteAddr, r.URL.Path, r.UserAgent())
w.Header().Set("Content-Type", "application/json")
w.Header().Set("Access-Control-Allow-Origin", "*")
w.Header().Set("Access-Control-Allow-Methods", "GET, OPTIONS")
login := strings.TrimSuffix(strings.TrimPrefix(r.URL.Path, "/"), ".json")