Quantcast
Channel: MikroTik
Viewing all articles
Browse latest Browse all 15172

Scripting • Re: Is 8MB in a variable from a txt file is possible?

$
0
0
I suspect there is a bug on http-header-field argument for fetch command, maybe it is not sent correctly (I didn't check this over local web server to analyse), download data is always 64512 bytes regardles which range is set in header when output=user as-value:
Code:
:put [:len ([/tool fetch url="https://public-dns.info/nameservers-all.txt" http-header-field="Range: bytes=0-1" output=user as-value]->"data")]64512
when output=file it downloads whole file:
Code:
/tool fetch url="https://public-dns.info/nameservers-all.txt" http-header-field="Range: bytes=0-1" output=file:delay 3:put [get "nameservers-all.txt" size]1396869
This indicates that Range header is not sent correctly.

Using curl is ok:
Code:
curl -s -H 'Range: bytes=0-1' https://public-dns.info/nameservers-all.txt | wc -c2

Statistics: Posted by optio — Sat Mar 30, 2024 6:53 pm



Viewing all articles
Browse latest Browse all 15172

Trending Articles