Skip to content

Commit

Permalink
document current trailing slash handling mechanisms (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
rtrembecky authored Dec 17, 2022
1 parent 67e80cc commit d0005a7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions docs/trailing-slash.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
Insight do toho, co sa deje v DevTools Network tabe a ako robime z FE requesty. Nejake fakty:
- BE django server ocakava requesty s koncovym lomitkom (trailing slash)
- next.js FE nerozlisuje medzi requestami kvoli tomu, ze navstivim nejaku stranku, a tym, ze nieco volam cez axios manualne
- v browseri chceme vidiet URL bez koncoveho lomitka
- next.js server tym padom vracia 308 Redirect na vsetky requesty s koncovym lomitkom a prepise ich takto na bezlomitkove (default spravanie, nastavitelne)
- kedze sa toto deje aj pre manualne requesty na BE, najprv vidime v Network tabe request, z ktoreho next.js odstrani lomitko, no tento request by django server odmietol, preto mame v [`next.config.js`](../next.config.js) definovany "rewrite", ktory to lomitko pridava 😅

0 comments on commit d0005a7

Please sign in to comment.