-
Notifications
You must be signed in to change notification settings - Fork 101
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix: Feed generates error to authorize upload #1633
Conversation
✅ Rule acceptance tests passed. |
337c2a8
to
411d23f
Compare
✅ Rule acceptance tests passed. |
411d23f
to
02a0ce7
Compare
✅ Rule acceptance tests passed. |
✅ Rule acceptance tests passed. |
File zipFile = new File(sourceUrl.toString()); | ||
String fileName = zipFile.getName().replace(".zip", ""); | ||
if (hasSubfolderWithGtfsFile(sourceUrl)) { | ||
|
||
if (containsGtfsFileInSubfolder( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After this change hasSubfolderWithGtfsFile(sourceUrl)
is not use any more (except in tests). Should we get rid of it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice catch! Done, Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
✅ Rule acceptance tests passed. |
Summary:
When using the feed URL https://www.maricopa-az.gov/home/showpublisheddocument/6491/638307291320330000, it generates an "Error authorizing upload." While verifying the
invalid_input_files_in_subfolder
notice, an additional request is sent to the producer's URL, causing unexpected behaviors (5XX HTTP code). This PR reuses the response already loaded in memory, avoiding unnecessary external calls and removing the root cause of the original issue.As part of this PR, the GTFS validator is sending the "User-Agent" header with the value "User-Agent: MobilityData GTFS-Validator/4.2.1 (Java 17.0.6)"
Fixes #1632
Closes #1562
How to reproduce the bug:
Expected behavior:
The report is generated without generating system errors.
Screenshot of the validation report after fixed:
Please make sure these boxes are checked before submitting your pull request - thanks!
gradle test
to make sure you didn't break anything