Develop#223
Merged
Merged
Conversation
There was a problem hiding this comment.
Pull request overview
This PR updates CORS handling to support Dojo-style local browser calls, but it also includes broad regenerated API test input churn unrelated to the stated CORS change.
Changes:
- Adds
localhost/127.0.0.1:3305to the non-production CORS allowlist. - Allows the
X-Requested-Withrequest header. - Regenerates many v1.5/v2.0 endpoint test request parameters.
Reviewed changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| app.js | Updates CORS origins and allowed headers. |
| test/v2.0-data-taxa-test.js | Changes generated taxa query parameters. |
| test/v2.0-data-speleothems-{collectionunitid}-test.js | Changes generated speleothem path ID. |
| test/v2.0-data-spatial-lakes-test.js | Changes generated lakes query parameters. |
| test/v2.0-data-spatial-icesheet-test.js | Changes generated ice sheet age query. |
| test/v2.0-data-spatial-faunal-test.js | Changes generated faunal query parameter. |
| test/v2.0-data-sites-test.js | Changes generated sites query parameters. |
| test/v2.0-data-sites-{siteid}-datasets-test.js | Changes generated site datasets path ID. |
| test/v2.0-data-sites-{siteid}-chronologies-test.js | Changes generated site chronologies path ID. |
| test/v2.0-data-publications-test.js | Changes generated publications query parameters. |
| test/v2.0-data-publications-{publicationid}-test.js | Changes generated publication path ID. |
| test/v2.0-data-pollen-test.js | Changes generated pollen query parameters. |
| test/v2.0-data-pollen-{id}-test.js | Changes generated pollen path ID. |
| test/v2.0-data-occurrences-test.js | Changes generated occurrences query parameters. |
| test/v2.0-data-geopoliticalunits-test.js | Changes generated geopolitical units query parameters. |
| test/v2.0-data-geopoliticalunits-{gpid}-test.js | Changes generated geopolitical unit path ID. |
| test/v2.0-data-geopoliticalunits-{gpid}-sites-test.js | Changes generated geopolitical sites path ID. |
| test/v2.0-data-geopoliticalunits-{gpid}-datasets-test.js | Changes generated geopolitical datasets path ID. |
| test/v2.0-data-dbtables-test.js | Changes generated dbtables query parameter. |
| test/v2.0-data-dbtables-{table}-test.js | Changes generated dbtables path/query values. |
| test/v2.0-data-datasets-test.js | Changes generated datasets query parameters. |
| test/v2.0-data-datasets_elc-test.js | Changes generated ELC datasets query parameters. |
| test/v2.0-data-contacts-test.js | Changes generated contacts query parameters. |
| test/v2.0-data-contacts-{contactid}-test.js | Changes generated contact path ID. |
| test/v2.0-data-contacts-{contactid}-sites-test.js | Changes generated contact sites path ID. |
| test/v2.0-data-chronologies-{chronid}-test.js | Changes generated chronology path ID. |
| test/v2.0-data-aggregatedatasets-{aggdatasetid}-test.js | Changes generated aggregate dataset path ID. |
| test/v2.0-apps-taphonomysystems-test.js | Changes generated taphonomy query parameter. |
| test/v2.0-apps-depenvt-test.js | Changes generated depositional environment query parameters. |
| test/v2.0-apps-constdb-datasetuploads-test.js | Changes generated constituent DB uploads query parameter. |
| test/v2.0-apps-constdb-datasets-test.js | Changes generated constituent DB datasets query parameter. |
| test/v2.0-apps-constdb-datasetages-test.js | Changes generated constituent DB ages query parameter. |
| test/v1.5-data-geopoliticalunits-test.js | Changes generated v1.5 geopolitical query parameters. |
| test/v1.5-data-geopoliticalunits-{gpid}-test.js | Changes generated v1.5 geopolitical path ID. |
| test/v1.5-data-contacts-{contactid}-test.js | Changes generated v1.5 contact path ID. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| it('should respond 200 for "A taxon or array of taxa."', function() { | ||
| var response = request('get', 'http://localhost:3001/v2.0/data/taxa', { | ||
| 'qs': {"taxonname":"in labore proident","taxagroup":"est esse dolore","ecolgroup":"dolor exercitation nostrud","status":0,"limit": 10,"offset": 0}, | ||
| 'qs': {"taxonname":"do exercitation magna officia cupidatat","taxagroup":"sit commodo","ecolgroup":"laboris elit","status":0,"limit": 10,"offset": 0}, |
| }, | ||
| credentials: true, | ||
| allowedHeaders: ['Content-Type', 'Authorization'], | ||
| allowedHeaders: ['Content-Type', 'Authorization', 'X-Requested-With'], |
Comment on lines
+43
to
+45
| : [ 'http://localhost:5173', 'http://127.0.0.1:5173', | ||
| 'http://localhost:3305', 'http://127.0.0.1:3305' | ||
| ]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Updated the CORS to accept dojo calls