Commit c9d2b81
committed
Self-review: close the account oracle, cache the roster, use showProfiles
The profile endpoint answered 200 for a name with a website account and 404 for
one without, whenever the name had never played — one request per name, no
credential needed. That is the enumeration oracle closed in #105, rebuilt in a
different route. isRegistered is consulted only when the viewer is already
authenticated as that name, which keeps the case it was there for: someone who
registered on a server that has never run can still see their own profile.
getPlayers NBT-parses every player .dat in the world. Every other public route
answers from memory, and the per-address budget allows ten requests a second, so
one visitor could have the whole world folder parsed ten times a second without
signing in. Cached for ten seconds, shared across callers. The client made it
worse: refreshWhoami re-fetched whenever puuid was empty, which it stays for a
player who registered but never joined, so every navigation fired another roster
parse. It tries once per page load now.
showProfiles was added to the public payload and never read, so with no server
behind the site the header linked a visitor to a page that says "no such player"
about themselves.1 parent eb16f91 commit c9d2b81
3 files changed
Lines changed: 84 additions & 18 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4521 | 4521 | | |
4522 | 4522 | | |
4523 | 4523 | | |
4524 | | - | |
| 4524 | + | |
| 4525 | + | |
| 4526 | + | |
| 4527 | + | |
| 4528 | + | |
| 4529 | + | |
| 4530 | + | |
| 4531 | + | |
| 4532 | + | |
| 4533 | + | |
| 4534 | + | |
| 4535 | + | |
| 4536 | + | |
| 4537 | + | |
| 4538 | + | |
4525 | 4539 | | |
4526 | | - | |
4527 | | - | |
4528 | | - | |
4529 | | - | |
| 4540 | + | |
| 4541 | + | |
| 4542 | + | |
| 4543 | + | |
| 4544 | + | |
4530 | 4545 | | |
4531 | 4546 | | |
4532 | 4547 | | |
4533 | 4548 | | |
4534 | 4549 | | |
4535 | | - | |
4536 | | - | |
4537 | | - | |
| 4550 | + | |
| 4551 | + | |
| 4552 | + | |
| 4553 | + | |
| 4554 | + | |
4538 | 4555 | | |
4539 | 4556 | | |
4540 | 4557 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
268 | 268 | | |
269 | 269 | | |
270 | 270 | | |
271 | | - | |
| 271 | + | |
272 | 272 | | |
273 | | - | |
274 | | - | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
275 | 280 | | |
276 | 281 | | |
277 | 282 | | |
| |||
310 | 315 | | |
311 | 316 | | |
312 | 317 | | |
313 | | - | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
314 | 324 | | |
315 | 325 | | |
316 | 326 | | |
| |||
548 | 558 | | |
549 | 559 | | |
550 | 560 | | |
551 | | - | |
552 | | - | |
| 561 | + | |
| 562 | + | |
553 | 563 | | |
554 | 564 | | |
555 | 565 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
41 | 69 | | |
42 | 70 | | |
43 | 71 | | |
| |||
527 | 555 | | |
528 | 556 | | |
529 | 557 | | |
| 558 | + | |
| 559 | + | |
530 | 560 | | |
531 | 561 | | |
532 | 562 | | |
| |||
543 | 573 | | |
544 | 574 | | |
545 | 575 | | |
546 | | - | |
547 | | - | |
548 | | - | |
| 576 | + | |
549 | 577 | | |
550 | | - | |
| 578 | + | |
| 579 | + | |
| 580 | + | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
551 | 590 | | |
552 | 591 | | |
553 | 592 | | |
| |||
0 commit comments