Skip to content

Commit 9a37e81

Browse files
author
Cihad Tekin
committed
[push] Fixed the options of the request being made during mime detection
1 parent 7cb9bd3 commit 9a37e81

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## Version 25.03.XX
2+
Fixes:
3+
- [push] Fixed the options of the request being made during mime detection
4+
15
## Version 25.03.26
26
Fixes:
37
- [push] Fixed timeout setting

plugins/push/api/proxy.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,6 @@ function request(url, method, conf) {
147147
let opts = {}, proto;
148148
try {
149149
let u = new URL(url);
150-
opts.host = u.hostname;
151-
opts.port = u.port;
152-
opts.path = u.pathname;
153-
opts.protocol = u.protocol;
154150
proto = u.protocol.substring(0, u.protocol.length - 1);
155151
if (!protos[proto]) {
156152
return new Error('Invalid protocol in url ' + url);
@@ -161,7 +157,7 @@ function request(url, method, conf) {
161157
}
162158
catch (e) {
163159
log.e('Failed to parse media URL', e);
164-
opts = {method, url};
160+
opts = {method};
165161
proto = url.substr(0, url.indexOf(':'));
166162
}
167163

@@ -175,9 +171,7 @@ function request(url, method, conf) {
175171
});
176172
opts.agent = new Agent();
177173
}
178-
179-
opts.url = url;
180-
return protos[proto].request(opts);
174+
return protos[proto].request(url, opts);
181175
}
182176

183177

0 commit comments

Comments
 (0)