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 Web.Scotty.Cookie #293

Merged
merged 9 commits into from
Jun 21, 2023
Merged

add Web.Scotty.Cookie #293

merged 9 commits into from
Jun 21, 2023

Conversation

ocramz
Copy link
Collaborator

@ocramz ocramz commented Jun 10, 2023

addresses #253

cc @chessai ^^

@chessai
Copy link
Contributor

chessai commented Jun 10, 2023

this LGTM

Can you add tests?

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 10, 2023

I don't understand why is CI failing ; I've built thir PR successfully with GHC 9.2.7

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 10, 2023

I was afraid I would have to pull webdriver out but we have hspec-wai :)

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 10, 2023

Tests added @chessai ^^ LMK

-- ==== Cookie Configuration
--
-- Cookies have several configuration options; a brief summary of each option is given below. For more information, see <http://tools.ietf.org/html/rfc6265#section-4.1.2 RFC 6265> or <https://en.wikipedia.org/wiki/HTTP_cookie#Cookie_attributes Wikipedia>.
data SetCookie = SetCookie
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason behind duplicating the cookie package's definition?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mainly to decouple them, but it's also unlikely that the definition of a web cookie will change in the future, so I will revert to importing 'cookie' rather than vendoring it in.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, I think that's better

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 11, 2023

@fumieval we now import 'cookie' and re-export some of its definitions.

-- ** parsing and rendering
, parseSetCookie
, renderCookies
, renderCookiesText
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps "parsing and rendering" section is not necessary

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've fixed this^^

Copy link
Collaborator

@fumieval fumieval left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 14, 2023

Hi @fumieval , could you merge this if there are no more questions?

@chessai
Copy link
Contributor

chessai commented Jun 14, 2023

Just triggered CI, if it passes I'll merge

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 14, 2023

CI failures are most puzzling. I did introduce two new dependencies in this PR (cookie and time), and perhaps the lower bounds need to be relaxed (even though neither of them is mentioned in the CI failures). I've only tested this PR with stack, I don't use cabal

scotty.cabal Outdated
@@ -86,6 +88,7 @@ Library
network >= 2.6.0.2 && < 3.2,
regex-compat >= 0.95.1 && < 0.96,
text >= 0.11.3.1 && < 2.1,
time >= 1.11,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

time >= 1.11 seems too strict. How about >= 1.8?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done! All tests are green on my end, try running CI again?

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 15, 2023

@fumieval I've gotten rid of some unnecessary imports in one of the example binaries. Hopefully now CI will be green at least for the recent GHCs. I really don't know why don't older GHCs work

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 16, 2023

The CI failure for 8.6.5 seems to be due to a change in a recent version of 'wai-extra' which now imports 'crypton-x509' instead of 'x509'

https://github.com/scotty-web/scotty/actions/runs/5282948607/jobs/9564762917?pr=293#step:17:61

The failures on GHC <= 8.0.2 are still mysterious to me

@fumieval
Copy link
Collaborator

I think it's fine to drop support for GHC < 8.10 (there's #289 too). Thoughts? @chessai @RyanGlScott

@ocramz
Copy link
Collaborator Author

ocramz commented Jun 21, 2023

Can I do something to get this PR across the finish line?

@chessai
Copy link
Contributor

chessai commented Jun 21, 2023

I think it's fine to drop support for GHC < 8.10 (there's #289 too). Thoughts? @chessai @RyanGlScott

Fine by me

@fumieval fumieval merged commit f993894 into scotty-web:master Jun 21, 2023
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.

3 participants