Skip to content
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

Add CORS tests #1162

Merged
merged 2 commits into from May 9, 2021
Merged

Add CORS tests #1162

merged 2 commits into from May 9, 2021

Conversation

Nadrieril
Copy link
Member

@Nadrieril Nadrieril commented May 1, 2021

This is a draft to let me figure out how to do this
EDIT: no longer a draft. This PR works as far as I can tell. The PR is self-referential cause I use raw.githubusercontent as target for some of the tests, but merging doesn't change the merged commits so this should keep working.

@Nadrieril
Copy link
Member Author

Nadrieril commented May 1, 2021

I'm confused: with latest dhall-haskell (1.38.1), if I do

echo "https://raw.githubusercontent.com/Nadrieril/dhall-lang/cors-tests/tests/import/data/cors/AllowedAll.dhall" | dhall

I get a "Not CORS compliant" error. But this fetches https://test.dhall-lang.org/cors/AllowedAll.dhall which returns a "*" CORS header.

curl -i -X OPTIONS https://test.dhall-lang.org/cors/AllowedAll.dhall

returns, as expected, access-control-allow-origin: *.

I don't see what could be wrong, @Gabriel439 do you know what might be happening? Could this be an issue with dhall-haskell?
EDIT: I did some tests with the rust impl and managed to get something working. I think it's a dhall-haskell bug, unless my impl is too lenient somewhere

@Gabriella439
Copy link
Contributor

Yeah, that seems like a bug in dhall-haskell. I'm looking into it.

@Nadrieril
Copy link
Member Author

Nadrieril commented May 7, 2021

Ok, then I'll trust my own implementation. This PR works as far as I can tell. The PR is self-referential cause I use raw.githubusercontent as target for some of the tests, but merging doesn't change the merged commits so this should keep working.

@Nadrieril Nadrieril marked this pull request as ready for review May 7, 2021 23:35
@Nadrieril Nadrieril merged commit 5ff7ecd into dhall-lang:master May 9, 2021
@Nadrieril Nadrieril deleted the cors-tests branch May 9, 2021 17:30
@Nadrieril Nadrieril mentioned this pull request May 9, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants