Skip to content

Commit

Permalink
Check for suggested_filename in opts table
Browse files Browse the repository at this point in the history
If the opts table contains a key suggested_filename,
it will override the one that webkit would provide
based on uri and headers. The suggested file name will
be passed down to signals for further processing, just
like the one webkit suggests.
  • Loading branch information
Michishige Kaito committed Nov 5, 2012
1 parent 4ca237d commit 74f7c05
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/downloads.lua
Expand Up @@ -122,7 +122,7 @@ function add(uri, opts)

-- Emit signal to get initial download location
local fn = _M.emit_signal("download-location", d.uri,
d.suggested_filename, d.mime_type)
opts.suggested_filename or d.suggested_filename, d.mime_type)

assert(fn == nil or type(fn) == "string" and #fn > 1,
string.format("invalid filename: %q", tostring(file)))
Expand Down

0 comments on commit 74f7c05

Please sign in to comment.