Right now this code fails when used with a JSON
decoder that always produces unicode. This isn't
usually the case with CPython, where simplejson
is used most of the time, however with the stdlib
JSON library (as used on PyPy), this code fails.
Change-Id: Ib2343243f40194d5b2784551a807c7f58970a6e9
Staticweb middleware always searchs html
for error response when response status code
is not redirect.
It causes swift to return error response
even if the request succeeded.
(e.g. When finding index.html with 200,
staticweb returns 200error.html
if it exist)
This patch modifies the constraint on response
status and fix bug 1204319.
Fixes bug #1204319.
Change-Id: Ib83c303917da7fb94999f2d4d35063b450d0e992
Make StaticWeb search for an index file rather than returning a 0-byte
object.
Add new StaticWeb header to identify a directory marker object:
X-Container-Meta-Web-Directory-Type (default to application/directory)
so user can specify the content type for directory marker objects.
This required requesting the container headers earlier in the code and
clearing the value of _error for non-404 errors.
Add unit tests for directory object scenarios.
Fix end tags in an unrelated HTML block.
Bug 1178817
DocImpact
Change-Id: I561f00c099feaa82fd658f5050bd90c76717da24
This patch fixes the Swift MemcacheRing set and set_multi
interface incompatible problem with python memcache. The fix
added two extra named parameters to both set and set_multi
method. When only time or timeout parameter is present, then one
of the value will be used. When both time and timeout are present,
the time parameter will be used.
Named parameter min_compress_len is added for pure compatibility
purposes. The current implementation ignores this parameter.
To make swift memcached methods all consistent cross the board,
method incr and decr have also been changed to include a new
named parameter time.
In future OpenStack releases, the named parameter timeout will be
removed, keep the named parameter timeout around for now is
to make sure that mismatched releases between client and server
will still work.
From now on, when a call is made to set, set_multi, decr, incr
by using timeout parametner, a warning message will be logged to
indicate the deprecation of the parameter.
Fixes: bug #1095730
Change-Id: I07af784a54d7d79395fc3265e74145f92f38a893
differently (if at all)
Adding a swift.source to wsgi pre_auth funcs and all middleware that makes
subrequests to proxy server.
NOTE: This change will result in a change in the number of proxy logs made for
staticweb, formpost, tempurl, and any other middleware that performs sub
requests (including swauth and SOS).
Please see docs for details.
DocImpact
Change-Id: I80cf2806add1c3d34054147e2515944be340455b
This change replaces WebOb with a mostly compatible local library,
swift.common.swob. Subtle changes to WebOb's API over the years have been a
huge headache. Swift doesn't even run on the current version.
There are a few incompatibilities to simplify the implementation/interface:
* It only implements the header properties we use. More can be easily added.
* Casts header values to str on assignment.
* Response classes ("HTTPNotFound") are no longer subclasses, but partials
on Response, so things like isinstance no longer work on them.
* Unlike newer webob versions, will never return unicode objects.
Change-Id: I76617a0903ee2286b25a821b3c935c86ff95233f
StaticWeb is now at http://gholt.github.com/swift-staticweb/
For current users of StaticWeb, this will require installing the new
package and changing the "use" line of the staticweb filter conf
section to:
use = egg:swiftstaticweb#middleware
And then 'swift-init proxy reload'.
Change-Id: Iab32adb5927698a667c5c6d6a572c44ca23414eb
The previous staticweb had the silly problem of global state for
concurrent requests. This fixes that.
Also, the WSGI spec indicates start_response might not be called
right away and is only guaranteed to be called just before the first
"chunk" of the output iterator returns. This fixes StaticWeb's
previously incorrect assumption.
A thorough review of this code would be much appreciated; I've
messed it up enough times to not be completely trusted with it.
Change-Id: Ie751c24e21db7a884a83a731fbf2f4309437302c
Small change to staticweb with container requests. Before, a request
to a container that had no x-container-meta-web-index and no
x-container-meta-web-listings would pass the request on to the proxy
server, even if x-web-mode was set to true. Now, if x-web-mode is set
true, it will 404.
This mostly important to folks that are using staticweb with an
external service that uses authenticated requests and x-web-mode set
to true, in which case the above 404 previously would return the
container listing (you were authenticated after all). Unauthenticated
requests would have received 401s anyway.
Change-Id: Ifd321a8a076a79c1e119c5259a40bf08defdbe3c
Fixes bug 939267. Return the quoted web-listings-css value
if it starts with '/', 'http://', or 'https://.' All other values
are treated as relative paths.
Change-Id: I55ee4ec77cf8db99aa48c9a398e29767b200e1eb