Changeset 1768


Ignore:
Timestamp:
Sep 14, 2010, 5:46:06 PM (9 years ago)
Author:
matthijs
Message:

luci-downloadmanager: Don't follow redirects on login.

By default, the httpclient library follows any redirects when doing a
request and then only returns the cookie data for the final request. For
login requests done by the downloadmanager, only the cookies from the
first request are relevant, so don't follow redirects.

This is needed to support hotfile.com.

References: #903

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/luci/applications/luci-downloadmanager/luasrc/model/cbi/dlmanager/auth.lua

    r1700 r1768  
    111111        else
    112112            -- No rapidshare url, do a normal request and store the
    113             -- returned cookies
     113            -- returned cookies. Pass depth = 0 to prevent following any
     114            -- redirects and to get the cookies from the first response.
    114115            local response
    115             code, response = httpc.request_raw(uri, {body = body})
     116            code, response = httpc.request_raw(uri, {body = body, depth = 0})
    116117            rcs = code and response.cookies
    117118        end
Note: See TracChangeset for help on using the changeset viewer.