Skip to content

Commit

Permalink
fix(Books): encode book URL when retrieving TOC from LibreTexts API
Browse files Browse the repository at this point in the history
  • Loading branch information
ethanaturner authored and jakeaturner committed May 9, 2024
1 parent 287ec72 commit 85b1224
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion server/util/bookutils.js
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@ export const getBookTOCFromAPI = (bookID, bookURL) => {
} else {
throw (new Error('tocretrieve'));
}
return axios.get(`https://api.libretexts.org/endpoint/getTOC/${bookAddr}`, {
return axios.get(`https://api.libretexts.org/endpoint/getTOC/${encodeURIComponent(bookAddr)}`, {
headers: { 'Origin': getProductionURL() }
});
}).then((tocRes) => {
Expand Down

0 comments on commit 85b1224

Please sign in to comment.