Age | Commit message (Collapse) | Author | Files | Lines |
|
With the release of RFC 7231 in June 2014 the HTTP status code 302 - Moved
Temporarily does no longer exist in this form and has been replaced by
302 - Found, which causes the browser to use the same request method to
call the new resource.
Which can cause unwanted deletions of resouces, when a child resource is
deleted and the browser gets redirected to the parent resource.
Instead we use now the status code 303 - See Others, which specifies, that
the referred resource has to be called using the GET method.
|
|
Now you can add special error pages for http error codes.
Currently it works only for 404 errors. If a route is called, which
isn't defined, the framwork gave our a generic 404 error page.
Now you can redirect this error to a controller, which allowes you to
create a special error handling for that case yourself.
you just need to add a route "404 => MyErrorController" to your routing
list. If it's not defined, noting will change and the old error message
will be returned as beforehand.
|
|
Updated the dependencies to current versions of the gems this framework
relies on. Also got the tests back running, as the synthax of RSpec
slightly changed the past years.
|
|
|
|
This adds the way to find out the actual ip of the client machine, even
if it is hidden behind a local reverse proxy.
|
|
This commit adds support for response cookies. Response now has a method
cookie to fetch the current cookie. One cookie has multiple crumbs which
represent a key value pair. For each crumb multiple options can be set
according to the specs.
|
|
|
|
|
|
This change sorts the routes to get the most specific routes first and
avoid hitting a route which is not the most specific match.
With this the regex to extract variables is made more strict to avoid
matching half of the URI.
|
|
This enables the user to render partial templates to embed them into
other templates and the like.
|
|
Browsers are not able to send put, delete or any other request from a
plain html form. This limits the possibilities with APIs so an override
was introduced in many frameworks in the form, that `_method` could be
defined in a post payload.
With this, zero also supports `_method` in the post payload to make it
possible to use all functions of the API with javascript through plain
html.
|
|
This fixes a bug where a charset in the content type blocked the
extraction of the payload.
A browser may send a string like
multipart/form-data; charset=UTF-8
which include? could not find the defined types. Now it gets split and
then checked against the defined types.
|
|
This makes it possible to push lists as paramters by naming the
variables with `[]` at the end, for example `foo[]`.
|
|
This extends the server class with the information, if it is serving
http or https. This can then be used to generate a root uri to the web
application.
|
|
This reverts commit 94a2d399eb81d59f9d66c5d16121611c4d1ae0cd.
|
|
|
|
The renderer is now a bit smaller and asks the TemplateFinder for the
actual resources. That way it can just concentrate on rendering instead
of finding out, which stuff actually exists and which not.
|
|
The template finder is now the instance to ask for templates. It was
already looking for them, so it should be able to handle questions
regarding the existence of templates too.
|
|
|
|
This step is a preparation to extend the functionality of the renderer.
To make the main class easier, the search for templates and building of
the tree is extracted into its own class.
|
|
That kills 52 mutations!
|
|
This fixes a bug where an empty route would catch all requests resulting
in all routes found with the empty route.
|
|
This is a step back but makes the controller work for the moment. It
should be reimplemented in a better way in the future.
|
|
|
|
|
|
|
|
As mutant can't use one spec file for both methods it got split up into
two. I also cleaned up the tests and made them (hopefully) better
readable.
|
|
This still needs some work, but it should definitly be easier to
generate new environments now. Why is that even so much work?
|
|
The tests now use simple lists for the types to make it easier to
distinguish between all elements.
The tests themselves are also shared now.
|
|
|
|
|
|
This makes the assignment for bodies easier when using plain Strings.
They get wrapped in an array as per rack definition.
For every other type, they have to implement each and get directly set
as body or have to be rendered to Strings first.
|
|
|
|
Created folder spec/unit/zero and moved all unittest into this folder.
|
|
|
|
|
|
Fix tests for PATCH, because spec_helper didn't support it and the tests where
wrong.
Remove if statement from "conent_type", because ruby already returns nil, if the
requested key in a hash is not found. (Sounds a bit ugly, but it's true.)
|
|
I've also changed "extract_query_params" because it does not matter, if the
query string it empty or not for the "parse_string" method.
|
|
Killed 13 of 14 mutants. I will see later, how it's possible to kill the last
one.
I also fixed the return value of "preferred", if the in initialize given string
is empty. Fixed the default value here.
|
|
|
|
|
|
|
|
The fixes for Ruby 1.8 will take place in a seperate gem. So I remove
all the changes here.
|
|
|
|
|
|
Now a query string cannot look like 'foo=bar=foo' anymore.
|
|
Seperates now foo=bar&bar=foo;baz=foo queries. But does not fix url
encoded strings and such things.
Also added testcase for an empty query string.
|
|
Plus some specs.
This should it make later possible to make Zero work with Ruby 1.8. But
at the moment it only routes to the original decode_www_form method, if
it exists. Otherwise it returns an empty Array. So this will still fail
on the 1.8 versions at the moment.
|
|
The splitting of rendering and processing is good, but on the other side
it makes some double steps or even introduce workarounds.
That is why I made the method #render just a call to the renderer. This
should help much more than the strict seperation.
The method will only return the resulting string and not add it to the
body of the response. That still has to be taken care of by the user.
|
|
|