-
Notifications
You must be signed in to change notification settings - Fork 587
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
teacher tool: misc tidy stuff #9870
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1037,21 +1037,40 @@ | |
}; | ||
|
||
const serveWebappFile = (webappName: string, webappPath: string) => { | ||
const webappUri = url.parse(`http://localhost:3000/${webappPath}${uri.search || ""}`); | ||
http.get(webappUri, r => { | ||
const webappUri = url.parse(`http://127.0.0.1:3000/${webappPath}${uri.search || ""}`); | ||
const request = http.get(webappUri, r => { | ||
let body = ""; | ||
r.on("data", (chunk) => { | ||
body += chunk; | ||
}); | ||
r.on("end", () => { | ||
if (body.includes("<title>Error</title>")) { // CRA development server returns this for missing files | ||
res.writeHead(404, { | ||
'Content-Type': 'text/html; charset=utf8', | ||
}); | ||
res.write(body); | ||
return res.end(); | ||
} | ||
if (!webappPath || webappPath === "index.html") { | ||
body = expandWebappHtml(webappName, body); | ||
} | ||
res.writeHead(200); | ||
if (webappPath) { | ||
res.writeHead(200, { | ||
'Content-Type': U.getMime(webappPath), | ||
}); | ||
} else { | ||
res.writeHead(200, { | ||
'Content-Type': 'text/html; charset=utf8', | ||
}); | ||
} | ||
res.write(body); | ||
res.end(); | ||
}); | ||
}); | ||
Check failure Code scanning / CodeQL Server-side request forgery Critical
The
URL Error loading related location Loading user-provided value Error loading related location Loading The URL Error loading related location Loading |
||
request.on("error", (e) => { | ||
console.error(`Error fetching ${webappUri.href} .. ${e.message}`); | ||
error(500, e.message); | ||
}); | ||
}; | ||
|
||
const webappIdx = webappNames.findIndex(s => new RegExp(`^-{0,3}${s}$`).test(elts[0] || '')); | ||
|
This file was deleted.
This file was deleted.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
.vscode | ||
build | ||
!package-lock.json | ||
src/Fonts.css |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,17 +7,16 @@ | |
<meta name="theme-color" content="#000000" /> | ||
<meta | ||
name="description" | ||
content="MakeCode Teacher Tool. Automatically analyze and evaluate projects." | ||
content="MakeCode Project Insights. Designed to help teachers evaluate student projects using a rubric." | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. FYI, don't need to block on this, but in our sync yesterday, there was some disagreement around the name Project Insights. We probably need to have a meeting with branding folks to hash this out. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure. We can keep iterating on it. |
||
/> | ||
<link rel="stylesheet" data-rtl="/blb/rtlsemantic.css" href="/blb/semantic.css" type="text/css"> | ||
<link rel="stylesheet" href="/blb/icons.css" type="text/css"> | ||
<link rel="stylesheet" href="/blb/react-common-teachertool.css" type="text/css"> | ||
<!-- <link rel="apple-touch-icon" href="/teachertool-data/logo192.png" /> --> | ||
<!-- | ||
manifest.json provides metadata used when your web app is installed on a | ||
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/ | ||
--> | ||
<link rel="manifest" href="/teachertool-data/manifest.json" /> | ||
<!-- <link rel="manifest" href="/teachertool-data/manifest.json" /> --> | ||
<title>MakeCode Teacher Tool</title> | ||
<script> | ||
// This line gets patched up by the cloud | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm surprised. Did something change, or has this always been unnecessary?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's always been unnecessary, and was causing the react-common css to be loaded twice. Duplicates of every class.