view · edit · sidebar · attach · print · history

Index>

20161025-steinwies-rack-post

Summary

  • port sbsm/steinwies.ch to use the rack webserver. Fix handling POST requests
  • Keep in Mind

Commits

Index

port sbsm/steinwies.ch to use the rack webserver. Fix handling POST requests

Why does a POST request not return the correct content? Continuing to see where I have to call translate_uri and fix the request_path.

Finallly I have two session, which break exactly after I submit the form content. With mod_ruby active_state.trigger(event()) in process(request) method returns a Steinwies::ConfirmState, whereas in Rack I get Steinwies::HomeState. Why? In mod_ruby the @active_state is Steinwies::KontaktState, whereas in Rack it is Steinwies::HomeState.

Looking at http://www.rubydoc.info/github/rack/rack/Rack/Session/Pool. The logout is called, because a new session is initialized with each request. I must persist the session.

Found that under webrick, I got a logout after each get because the init view had as kontakt SBSM::UnknownUser.

Looking at https://codenoble.com/blog/understanding-rack-middleware/. Creating a minimal test file to see on howto preserve session over different requests.

Patched config.ru and src/util/app.rb to show a very simple app with the session id. This work now. See Attach:config_ru.txt and Attach:config_app_rb.txt

Reworking the status handling inside sbsm. But things are complicated because we use Drb. Could we get rid of Drb and relay on the fact that the Rack webserver is in any case a different linux process than Apache. Also if our app is (is it really?) multi-threaded enabled we could use a rack middleware, which has this capabiility.

Reworked sbsm and I now the session-id persists. Unit test of sbsm pass again. Unit tests of steinwies don't work at all, because the HTTP server is started, but no unit test starts. Pages display again, but the charset is wrong as I shortcutted some header settings. Also submitting the kontakt form still has the wrong state.

Pushed commits:

Must be fixed tomorrow.

view · edit · sidebar · attach · print · history
Page last modified on October 25, 2016, at 07:43 PM