Tighten up auth regex
This commit is contained in:
@@ -26,7 +26,7 @@ module Micropub
|
|||||||
# Pull out and verify the authorization header or access_token
|
# Pull out and verify the authorization header or access_token
|
||||||
|
|
||||||
if req.env["HTTP_AUTHORIZATION"]
|
if req.env["HTTP_AUTHORIZATION"]
|
||||||
header = req.env["HTTP_AUTHORIZATION"].match(/Bearer (.*)$/)
|
header = req.env["HTTP_AUTHORIZATION"].match(/^Bearer (.*)$/)
|
||||||
access_token = header[1] unless header.nil?
|
access_token = header[1] unless header.nil?
|
||||||
elsif req.params["access_token"]
|
elsif req.params["access_token"]
|
||||||
access_token = req.params["access_token"]
|
access_token = req.params["access_token"]
|
||||||
|
Reference in New Issue
Block a user