laidig / gtfs-validator

A Java framework for GTFS validation and statistics.
MIT License
4 stars 1 forks source link

gtfs-validator-webapp does not allow to view JSON file reports that contains '://' #7

Closed mohangandhiGH closed 7 years ago

mohangandhiGH commented 7 years ago

We are actually trying to use gtfs-validator-webapp in the project https://github.com/CUTR-at-USF/gtfs-realtime-validator and we encountered with this problem while trying to view output json file from a web server for example, 'localhost:8080/laidig_webapp/index.html?report=http://localhost:8080/out.json'.

This throws an error ''Only local reports may be viewed, message: Please specify a local report to view''. As gtfs-validator-webapp does not allow json reports containing '://' in the report parameter value (as shown in above example i.e., http://localhost:8080/out.json), Is that fine to reconsider the decision to allow the report parameter to contain '://'

Here is the condition in validation.js file that does not allow paths with '://'

if (params.report.indexOf('//') == 0 || params.report.indexOf('://') != -1) { new ErrorView({ model: new ErrorModel({title: 'Only local reports may be viewed', message: 'Please specify a local report to view'}) }).render().$el.appendTo('#content'); return; }

laidig commented 7 years ago

PRs gladly accepted

On Mon, Jan 30, 2017 at 10:38 PM, mohangandhiGH notifications@github.com wrote:

We are actually trying to use gtfs-validator-webapp in the project https://github.com/CUTR-at-USF/gtfs-realtime-validator and we encountered with this problem while trying to view output json file from a web server for example, 'localhost:8080/laidig_webapp/index.html?report=http:// localhost:8080/out.json'.

This throws an error ''Only local reports may be viewed, message: Please specify a local report to view''. As gtfs-validator-webapp does not allow json reports containing '://' in the report parameter value (as shown in above example i.e., http://localhost:8080/out.json), Is that fine to reconsider the decision to allow the report parameter to contain '://'

Here is the condition in validation.js file that does not allow paths with '://'

if (params.report.indexOf('//') == 0 || params.report.indexOf('://') != -1) { new ErrorView({ model: new ErrorModel({title: 'Only local reports may be viewed', message: 'Please specify a local report to view'}) }).render().$el.appendTo('#content'); return; }

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/laidig/gtfs-validator/issues/7, or mute the thread https://github.com/notifications/unsubscribe-auth/AAwdPW--tswlbzG6DAUXvMfjhWAnDleQks5rXqyigaJpZM4LyNN- .