<feed xmlns='http://www.w3.org/2005/Atom'>
<title>src/lib/libfetch/fetch.c, branch main</title>
<subtitle>FreeBSD source tree</subtitle>
<id>http://cgit.freebsd.org/src/atom?h=main</id>
<link rel='self' href='http://cgit.freebsd.org/src/atom?h=main'/>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/'/>
<updated>2024-08-21T12:35:27Z</updated>
<entry>
<title>libfetch: don't include fragments in HTTP requests</title>
<updated>2024-08-21T12:35:27Z</updated>
<author>
<name>Pietro Cerutti</name>
<email>gahr@FreeBSD.org</email>
</author>
<published>2024-08-21T12:35:27Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1af7d5f389536a2f391153513d95d92ffdf360e4'/>
<id>urn:sha1:1af7d5f389536a2f391153513d95d92ffdf360e4</id>
<content type='text'>
Summary:
Fragments are reserved for client-side processing, see
https://www.rfc-editor.org/rfc/rfc9110.html#section-7.1

Also, some servers don't like to receive HTTP requests with fragments.

```
$ fetch 'https://dropbox.com/a/b'
fetch: https://dropbox.com/a/b: Not Found

$ fetch 'https://dropbox.com/a/b#'
fetch: https://dropbox.com/a/b#: Bad Request
```

This is a real-world scenario, where some download link from dropbox
(eventually) redirects to an URL with a fragment:

```
$ fetch -v 'https://www.dropbox.com/sh/&lt;some&gt;/&lt;thing&gt;?dl=1' 2&gt;&amp;1 | grep requesting
requesting https://www.dropbox.com/sh/&lt;some&gt;/&lt;thing&gt;?dl=1
requesting https://www.dropbox.com/scl/fo/&lt;foo&gt;/&lt;bar&gt;?rlkey=&lt;baz&gt;&amp;dl=1
requesting https://&lt;boo&gt;.dl.dropboxusercontent.com/zip_download_get/&lt;some-long-strig&gt;#
```

See how the last redirect ends with a `#`.

Currently, libfetch includes the ending fragment and makes it impossible
to download the file.

Differential Revision:	https://reviews.freebsd.org/D46318
MFC after:		2 weeks
</content>
</entry>
<entry>
<title>libfetch: parse IPv4address in IPv6address properly</title>
<updated>2024-07-11T19:48:28Z</updated>
<author>
<name>Ka Ho Ng</name>
<email>khng@FreeBSD.org</email>
</author>
<published>2024-07-11T19:48:28Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8cd71a0e01d60cc4eb0cdef3c62556a516976b77'/>
<id>urn:sha1:8cd71a0e01d60cc4eb0cdef3c62556a516976b77</id>
<content type='text'>
This fix parsing problems of IPv6 addresses which contains IPv4
addresses. One example is ::192.168.0.1.

Documents are in below:
https://datatracker.ietf.org/doc/html/rfc2373#page-22

Sponsored by:	Juniper Networks, Inc.
MFC after:	1 week
Reviewed by:	jhibbits
Differential Revision:	https://reviews.freebsd.org/D45896
</content>
</entry>
<entry>
<title>libfetch: parse scheme://domain:/ correctly</title>
<updated>2024-03-25T20:11:42Z</updated>
<author>
<name>Ka Ho Ng</name>
<email>khng@FreeBSD.org</email>
</author>
<published>2024-03-25T20:10:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=fb860ed0c52c2c1e7792ef86718620a439663c7f'/>
<id>urn:sha1:fb860ed0c52c2c1e7792ef86718620a439663c7f</id>
<content type='text'>
This improves URL-parsing compability with cURL, and unbreaks parsing of
similar kinds of URLs after commit 8d9de5b10a24.

Sponsored by:	Juniper Networks, Inc.
Reviewed by:	des
MFC after:	1 week
Differential Revision:	https://reviews.freebsd.org/D44493
</content>
</entry>
<entry>
<title>lib: Automated cleanup of cdefs and other formatting</title>
<updated>2023-11-27T05:23:59Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-11-24T20:12:57Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=a2f733abcff64628b7771a47089628b7327a88bd'/>
<id>urn:sha1:a2f733abcff64628b7771a47089628b7327a88bd</id>
<content type='text'>
Apply the following automated changes to try to eliminate
no-longer-needed sys/cdefs.h includes as well as now-empty
blank lines in a row.

Remove /^#if.*\n#endif.*\n#include\s+&lt;sys/cdefs.h&gt;.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;.*\n+#if.*\n#endif.*\n+/
Remove /\n+#if.*\n#endif.*\n+/
Remove /^#if.*\n#endif.*\n/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/types.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/param.h&gt;/
Remove /\n+#include\s+&lt;sys/cdefs.h&gt;\n#include\s+&lt;sys/capsicum.h&gt;/

Sponsored by:		Netflix
</content>
</entry>
<entry>
<title>Remove $FreeBSD$: one-line .c pattern</title>
<updated>2023-08-16T17:54:42Z</updated>
<author>
<name>Warner Losh</name>
<email>imp@FreeBSD.org</email>
</author>
<published>2023-08-16T17:54:42Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=1d386b48a555f61cb7325543adbbb5c3f3407a66'/>
<id>urn:sha1:1d386b48a555f61cb7325543adbbb5c3f3407a66</id>
<content type='text'>
Remove /^[\s*]*__FBSDID\("\$FreeBSD\$"\);?\s*\n/
</content>
</entry>
<entry>
<title>libfetch: disallow invalid escape sequences</title>
<updated>2020-02-05T16:55:00Z</updated>
<author>
<name>Ed Maste</name>
<email>emaste@FreeBSD.org</email>
</author>
<published>2020-02-05T16:55:00Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=83372bda16b53157be476df6f9c6aac9f2bc12a3'/>
<id>urn:sha1:83372bda16b53157be476df6f9c6aac9f2bc12a3</id>
<content type='text'>
Per RFC1738 escape is "% hex hex"; other sequences do not form a valid URL.

Suggested by:	Matthew Dillon
Reviewed by:	Matthew Dillon
MFC after:	1 week
</content>
</entry>
<entry>
<title>Fix urldecode buffer overrun.</title>
<updated>2020-01-28T18:37:18Z</updated>
<author>
<name>Gordon Tetlow</name>
<email>gordon@FreeBSD.org</email>
</author>
<published>2020-01-28T18:37:18Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=6fb3f9944faefa41b322b5e1bc0d280b4005ca44'/>
<id>urn:sha1:6fb3f9944faefa41b322b5e1bc0d280b4005ca44</id>
<content type='text'>
Reported by:	Duncan Overbruck
Security:	CVE-2020-7450
</content>
</entry>
<entry>
<title>Improve URL parsing.  In particular, convert scheme and host to lowercase.</title>
<updated>2018-11-27T10:45:14Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2018-11-27T10:45:14Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=8d9de5b10a24bd2d79ed99f139c0ac28c09b15ca'/>
<id>urn:sha1:8d9de5b10a24bd2d79ed99f139c0ac28c09b15ca</id>
<content type='text'>
MFC after:	1 week
</content>
</entry>
<entry>
<title>Fix an inverted conditional in the netrc code, which would ignore the</title>
<updated>2018-05-29T13:07:36Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2018-05-29T13:07:36Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=5f04ebd4d3ed2b5970913c8b02b2b251a897a3c0'/>
<id>urn:sha1:5f04ebd4d3ed2b5970913c8b02b2b251a897a3c0</id>
<content type='text'>
value of $HOME and always use the home directory from the passwd
database, unless $HOME was unset, in which case it would use (null).

While there, clean up handling of netrcfd and add debugging aids.

MFC after:	3 weeks
</content>
</entry>
<entry>
<title>Use __VA_ARGS__ to simplify the DEBUG macro.</title>
<updated>2018-05-29T10:28:20Z</updated>
<author>
<name>Dag-Erling Smørgrav</name>
<email>des@FreeBSD.org</email>
</author>
<published>2018-05-29T10:28:20Z</published>
<link rel='alternate' type='text/html' href='http://cgit.freebsd.org/src/commit/?id=c5712d6da1ce9006a3147ab7c8be3b326d3dbc71'/>
<id>urn:sha1:c5712d6da1ce9006a3147ab7c8be3b326d3dbc71</id>
<content type='text'>
MFC after:	3 weeks
</content>
</entry>
</feed>
