-
-
Notifications
You must be signed in to change notification settings - Fork 25
London | SDC-Nov-25 | Ikenna Agulobi | Sprint 3 | Middleware #68
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
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
1 similar comment
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
Please could you help edit my PR title with the right meta data. It doesn’t allow me. I missed one pipe (|) between sprint 3 and middleware. |
This comment has been minimized.
This comment has been minimized.
OracPrime
left a comment
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.
A comment to understand, nothing to change. Excellent submission
| ``` | ||
| You are authenticated as Ahmed. | ||
| You have requested information about 1 subject: Bees. | ||
| `` |
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.
Nice! Many trainees haven't bothered with this file, but adding a readme like this is an excellent habit to get into.
| req.on("data", (chunk) => { | ||
| raw += chunk.toString("utf8"); | ||
| }); | ||
|
|
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.
This is a really strong submission, and I'm only raising this tiny technical point because there was nothing else wrong with the code. utf8 characters and be up to 4 bytes long. They're normally 1, but they can be 4. If that 4 byte sequence was split across two chunks, the toString would be incorrect. More robust would be something like
let chunks = [];
req.on("data", (chunk) => {
chunks.push(chunk);
});
req.on("end", () => {
const raw = Buffer.concat(chunks).toString("utf8");
// ... rest of the logic
});
But that's really quite subtle - don't worry about changing it.
Learners, PR Template
Self checklist
Changelist