Bug #2520
addHTTPAuth is broken in duktape
Status: | Invalid | Start date: | 01/25/2015 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | % Done: | 0% | ||
Category: | Ecmascript & Duktape | |||
Target version: | 4.10 | |||
Found in version: | 4.9.100 | Platform: | Linux |
Description
I'm doing:
plugin.addHTTPAuth('.*apple.com.*', function(req) { req.setHeader('User-Agent', 'QuickTime/7.6.2'); });
But ST sets ^ ancor and regex won't work
Adding HTTP insepction for pattern ^.*apple.com.*
History
#1
Updated by Andreas Smas about 6 years ago
- Status changed from New to Invalid
You need to include "http://"
#2
Updated by Leonid Protasov about 6 years ago
Andreas Ă–man wrote:
You need to include "http://"
I tried following and none of it works:
http://.*apple.com.* http:\/\/.*apple.com.* http:\/\/.*apple\.com.*
Only this works:
http://trailers.apple.com.*
I suppose the problem is ^ ancor.
#3
Updated by Andreas Smas about 6 years ago
Ok, so it seems that duktape converts the \. into just a dot
So you need to double escape.
.httpInspectorCreate('https://.*\\.apple\\.com/.*', function(req) { req.setHeader('User-Agent', 'QuickTime/7.6.2'); });
works for me
#4
Updated by Leonid Protasov about 6 years ago
Thanks. Worked like magic. Wiki is corrected correspondigly.