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

next does not preserve the POST params for other routes #147

Closed
nikita-volkov opened this issue Jan 29, 2015 · 7 comments
Closed

next does not preserve the POST params for other routes #147

nikita-volkov opened this issue Jan 29, 2015 · 7 comments
Labels
bug info needed More information is needed test needed

Comments

@nikita-volkov
Copy link

I had the following code to check, whether the user has access, until I found out that currently it's impossible to use forms with such an approach

    matchAny (regex "^/admin") $ do
      id <- fmap fst $ sessionState State.get
      case id of
        Nothing -> redirect "/login"
        Just id -> do
          adminAccess <- tx Nothing $ DB.adminAccess id
          unless adminAccess $ raise Unauthorised
          next
@xich
Copy link
Member

xich commented Jan 29, 2015

Ugh, thanks for reporting. I've got a rewrite of the way request bodies are handled that is about 80% done and should solve this. Unfortunately I'm on another deadline, so not likely to get it finished until next week.

@d12frosted
Copy link

The same here. Just wanted to add some logging for debug purposes.

@thomasjm
Copy link

Hello, is this bug still outstanding? I have a mysterious issue that would be explained by this...

@thomasjm
Copy link

Aha, I just confirmed that using next makes the body of a POST request disappear for subsequent routes :(

This is a big problem for me, did your rewrite ever get landed @xich ?

@ocramz
Copy link
Collaborator

ocramz commented Sep 25, 2023

@ocramz
Copy link
Collaborator

ocramz commented Sep 25, 2023

part of the fix could be to move ActionEnv inside a state-like variable : #131 (comment)

ocramz added a commit that referenced this issue Sep 27, 2023
* add test case

* add Web.Scotty.Body module

* test case fixed but other test fails :D

* move request max size test case under ScottyT and cleanup imports

* add counterexample test to setMaxRequestBodySize

---------

Co-authored-by: Marco Zocca <[email protected]>
@ocramz
Copy link
Collaborator

ocramz commented Sep 27, 2023

Fixed by #308

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug info needed More information is needed test needed
Projects
None yet
Development

No branches or pull requests

5 participants