Skip to content

Add CORS tests#1162

Merged
Nadrieril merged 2 commits intodhall-lang:masterfrom
Nadrieril:cors-tests
May 9, 2021
Merged

Add CORS tests#1162
Nadrieril merged 2 commits intodhall-lang:masterfrom
Nadrieril:cors-tests

Conversation

@Nadrieril
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Contributor

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

@Nadrieril
Copy link
Copy Markdown
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.

2 participants