adicu / data.adicu.com

API for Columbia data
http://data.adicu.com
13 stars 14 forks source link

Check time inputs #40

Open rbtying opened 10 years ago

rbtying commented 10 years ago

You can currently block a thread in the pool by giving invalid times. The time formatting is also unnecessarily rigorous (only HH:MM allowed, no validation).

Perhaps instead look at dateutil::parser::parse? Takes a ton of formats, easy to implement, and known failure modes.

zhemao commented 10 years ago

Sorry, I'm not that familiar with the codebase. Could you point to a specific part of the code in which this occurs?

rbtying commented 10 years ago

Call the courses v1 or the sections api with a starts_before, startsafter, or ends* GET parameter, and tornado will fail to close the connection, with an internal exception either in the model_functions module or the postgres interface. On Oct 8, 2013 9:59 AM, "Howard Mao" notifications@github.com wrote:

Sorry, I'm not that familiar with the codebase. Could you point to a specific part of the code in which this occurs?

— Reply to this email directly or view it on GitHubhttps://github.com/adicu/data.adicu.com/issues/40#issuecomment-25891913 .

zhemao commented 10 years ago

Okay, would you like to fix it? The relevant functions for courses_v2 sections are in "data/app/courses_v2.py" and "data/models/courses_v2/sections_functions.py". For courses v1, the files are "data/app/courses.py" and "data/models/courses/courses_functions.py".