tile38 icon indicating copy to clipboard operation
tile38 copied to clipboard

Add support for CORS in http requests

Open Kilowhisky opened this issue 1 month ago • 2 comments

Please do not open a pull request without first filing an issue and/or discussing the feature directly with the project maintainer.

Please ensure you adhere to every item in this list

  • [ ] This PR was pre-approved by the project maintainer
  • [x] I have self-reviewed the code
  • [x] I have added all necessary tests

Describe your changes

Adds support for OPTIONS HTTP request and returns necessary headers to allow CORS to function properly

Issue number and link

https://github.com/tidwall/tile38/issues/737

I'm not quite sure how testing should be performed here as I don't see any testing of the http interface right now.. maybe i'm missing something. Could use a pointer on where and how you'd like me to write tests.

Tests can be done with standard HTTP requests.

Kilowhisky avatar May 06 '24 23:05 Kilowhisky

Tests added

Kilowhisky avatar May 07 '24 05:05 Kilowhisky

Verified against my test project in chrome. Request works successfully.

Screenshot 2024-05-06 at 10 12 56 PM Screenshot 2024-05-06 at 10 14 00 PM Screenshot 2024-05-06 at 10 14 50 PM

Kilowhisky avatar May 07 '24 05:05 Kilowhisky