V2grad / Organizer

🗓 A Simple Semester Course Planner
https://organizer-rpi.vercel.app
MIT License
4 stars 1 forks source link

[External] Unable to request data source #36

Closed NeverBehave closed 5 years ago

NeverBehave commented 5 years ago

Describe the bug If user is using Organizer the first time, and is accessing an import page, the whole URL will be sent to API endpoint with full compress plan, which will be a bit of large.

Yacs API seems to have protection against and return refuse with 400 with Cookies or Header is too large, causing repeatedly error message Unable to fetch data

Sample Request

curl 'https://nightly.yacs.io/api/v6/courses.json?include=latest_listing' -H 'Accept: application/json, text/plain, */*' -H 'Referer: https://plan.v2grad.org/import/eMKcwpXClEFrHDEMwoXDv0rDsXkFwpJswo_DrT3DpsOQXgvCpcKnwpLCg2zDi2VhdzbDjMOsFkrDiH_Cr8K2woXCkjZkSGAOw4bDs8O8LH1PM8KPbsKWwpPCusK9w7s6w58Ww73Dg8OnwqPDjG7Dp8Omw7PDpcK2a8KrVU_Cul50WcOdw77Dm8Kjw7vCqcKywrg9I8Olwp17w5DDpXDDrsKmw7oow4fCoynDm8O5wrrCrMO6R8OXwq7Dq8OlfHLDuyHDh1V3w656PcOcwoTCvmfDtBkFOHLCgzBKwobDnHnCgMK0w5YTJk3CmcOZPcOtXjvCnmIMw4LCrQFzVAgaBxRsAVrDlV59wrI3w5I2wo4XJcKcQibCiC0kCEQTZCXChcOKwp0mw5XDolHDo8OvNsKOZ8Orw5HDnR3Cr8K6w6EWPcOHw4Q1Q8OgwoEQfMKwYigwNCpaw6LCqFLDvcOkwp7Drm8Gf8KhwpVnw5DCvjwswofDucO7wpvCsMORMGbDnAxbKQJBRsKGw5ojATXDosOmwqdCJGPCo1JGQcOCwoTCkMKGRAhTTcKQMxsGDV7DhMKXwpjDhxZ1wp0oR1TCgsOGw57CsMOlJMKQwoMGw4BcOcOVOk0hbMOdXkbDj0V8NDDCmcKteMK0w4zCh8Oxw6cUaklEGMK1PMKjw75pUcKdN8OsSGMWewDCicKswplQEsKUQQzCqcKkwoZNW8O0w4IvQnw9woU3wo_DrsKkw50iHh5qwqw2e8OJLsOPGjp0w7IhwogowpbCnDbDihYVwoNgGcO4woEEwqE0D8KFW8KCbkvCmyPCmlLDmxrDncKpw5l0J0Ygw6wGwpHCjWRRw7sQOsKHwohSw6pkAcO_w5cmw6PDtsKwwr0ufsOBw6RfKcK9w4fCl8Oew67Di8Ovw7HDpW3Dn8O7wp3Cuywywq9DwpdFw7tta8OnfsOYP8OscMKew53CnhDCkcKffgHCocOGfcKa' -H 'Origin: https://plan.v2grad.org' -H 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_14_1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/71.0.3578.98 Safari/537.36' -H 'DNT: 1' --compressed

Progress

We have contacted Yacs and reported this incident.

Suggestion

Access the main page once before import any plan to avoid API failure.