Staticweb returns error response even if a request succeeded

Bug #1204319 reported by Kota Tsuyuzaki
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Object Storage (swift)
Fix Released
Undecided
Kota Tsuyuzaki

Bug Description

Staticweb returns error response even if a request succeeded.

I have set up my container at my local laptop for staticweb as follows,

account: swift
container: demo

curl http://localhost:8080/v1/AUTH_swift/demo -X GET -H 'X-Auth-Token: AUTH_xxxxxxxxxxxxx' -v

> GET /v1/AUTH_swift/demo HTTP/1.1
< X-Container-Meta-Web-Error: error.html
< X-Container-Read: .r:*
< X-Container-Meta-Web-Index: index.html
404error.html
index.html

After that, I tried a following request without Token.

curl http://localhost:8080/v1/AUTH_swift/demo/ -v

Then, swift returned the content of index.html.
However staticweb middleware actually had searched 200error.html as following access log.

Jul 23 18:55:15 ubuntu swift - - 24/Jul/2013/01/55/15 GET /v1/AUTH_swift/demo/200error.html HTTP/1.0 499 - curl/7.22.0%20%28x86_64-pc-linux-gnu%29%20libcurl/7.22.0%20OpenSSL/1.0.1%20zlib/1.2.3.4%20libidn/1.23%20librtmp/2.3%20StaticWeb - - 70 - - - 0.0367 SW -
Jul 23 18:55:15 ubuntu swift 127.0.0.1 127.0.0.1 24/Jul/2013/01/55/15 GET /v1/AUTH_swift/demo/index.html HTTP/1.0 200 - curl/7.22.0%20%28x86_64-pc-linux-gnu%29%20libcurl/7.22.0%20OpenSSL/1.0.1%20zlib/1.2.3.4%20libidn/1.23%20librtmp/2.3%20StaticWeb - - 13 - - - 0.0518 SW -

When I uploaded 200error.html in the demo container as a test,
that request returned the content of 200error.html even if index.html existed.

Swift version: 1.9.1

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to swift (master)

Fix proposed to branch: master
Review: https://review.openstack.org/38425

Changed in swift:
assignee: nobody → Kota Tsuyuzaki (tsuyuzaki-kota)
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to swift (master)

Reviewed: https://review.openstack.org/38425
Committed: http://github.com/openstack/swift/commit/0508842470ab27e5635d858bf0f9c8c14e1b300e
Submitter: Jenkins
Branch: master

commit 0508842470ab27e5635d858bf0f9c8c14e1b300e
Author: Kota Tsuyuzaki <email address hidden>
Date: Tue Jul 23 19:28:08 2013 -0700

    Fix incorrect status handling at staticweb

    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

Changed in swift:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in swift:
milestone: none → 1.9.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.