microbit-foundation / python-editor-v3

Micro:bit Educational Foundation Python Editor V3
https://python.microbit.org
MIT License
54 stars 36 forks source link

Links to API docs containing periods result in a 403 #1099

Open microbit-matt-hillsdon opened 1 year ago

microbit-matt-hillsdon commented 1 year ago

Bug Description

This works: https://python.microbit.org/v/3/api/gc This does not: https://python.microbit.org/v/3/api/microbit.audio.SoundEffect (403 forbidden)

Presumably a glitch in the fallback routing that we have to serve the index page. Probably needs fixing outside this repo but tracking here.

microbit-matt-hillsdon commented 1 year ago

The routing function is using the presence of a dot in the final part to avoid sending the HTML of the app on the assumption it's an asset path. We either need a different rule or we change these URLs. As they've never worked that seems to be an option. E.g. s/[.]/-/g ? Or perhaps / ?

https://python.microbit.org/v/3/api/microbit/audio/SoundEffect seems like it makes perfect sense.