Commit Graph

22 Commits

Author SHA1 Message Date
Matthew Flatt
b8b8260379 net/url: add `current-url-encode-mode'
Changing `current-url-encode-mode' from 'recommended to 'unreserved
causes `url->string' to encode !, *, ', (, and ) using %, which
can avoid confusing some parsers.

See also https://github.com/plt/racket/pull/198
2012-12-17 06:56:38 -07:00
Philippe Mechai
d8ff661118 path->url: ensure directory paths have a trailing slash
If a path to a directory is converted to an URL it loses
           its trailing path separator.
           This can lead to a bug if the URL is used as a base URL to
           build other URLs (e.g. combine-url/relative).
2012-11-27 08:46:34 -07:00
Marc Burns
25bc661a03 Fix socket leak on redirected `*-pure-port' calls.
A port over which a redirection is served to get-pure-port is not closed
if `get-pure-port' follows the redirection.  This leaks file descriptors
on the host machine.
2012-10-05 11:14:38 -04:00
Matthew Flatt
3fb42cf3f1 scribble/html-properties: allow URLs in css-addition' and js-addition' 2012-09-11 18:52:59 -06:00
Jay McCarthy
a1e855a035 adding an optional argument to get-pure-port/headers 2012-08-16 14:47:09 -06:00
Jay McCarthy
23226b41da Preserve scheme, user, host, and port if the redirection doesn't have them 2012-08-14 21:34:02 -06:00
Jay McCarthy
f2e0e0bfeb get-port-port/headers should not remove status line 2012-08-14 21:34:01 -06:00
Robby Findler
f5449f38e8 adjust url-exception so it recognizes the same exceptions it used to 2012-04-01 22:16:35 -05:00
Robby Findler
97b76d474e some cleanups, thanks to Eli 2012-03-30 10:44:42 -05:00
Robby Findler
86572cc8c3 adjust the contract on string->url so that it actually catches all of
the errors that would be signalled by the body. also, remove
url-regexp from the exports (it was only recently added)

I believe this eliminates two of Eli's concerns:

  - the contract is no longer so painful to read

  - the performance is more reasonable.

Specifically, for the performance, here are the times I see to call
string->url on "http://www.racket-lang.org":

no contract: any/c
cpu time: 564 real time: 566 gc time: 3

weak contract: (-> (or/c string? bytes?) url?)
cpu time: 590 real time: 590 gc time: 3

strong, regexp-based contract:
(-> (or/c (not/c #rx"^([^:/?#]*):") #rx"^[a-zA-Z][a-zA-Z0-9+.-]*:") url?)
cpu time: 632 real time: 633 gc time: 5

This appears to be about a 10% slowdown for the regexp-based contract
over the weaker contract.

related to PR 12652
2012-03-29 19:31:32 -05:00
Robby Findler
fdf3fa6492 apply Andy's diff (and adjust the documentation correspondingly)
closes PR 12652
2012-03-27 12:21:17 -05:00
Eli Barzilay
999e481785 Fix apparent bug.
In the new-ish code for following redirections, the `strings' argument
wasn't passed along as it did before.
2012-02-01 21:51:47 -05:00
Jay McCarthy
41e04b33da Revert "This fixes 10497 and potentially breaks programs that assume the query of a URL is always a list. I have fixed uses in the Web Server, which I expect is the major thing affected, but much more could be. Therefore I am skeptical this is a good idea just for the representation of ?. So, I'd like other people to review the change and let me know if they think I should revert it."
This reverts commit 7f9818bb3e.
2011-11-23 11:13:20 -07:00
Jay McCarthy
7f9818bb3e This fixes 10497 and potentially breaks programs that assume the query of a URL is always a list. I have fixed uses in the Web Server, which I expect is the major thing affected, but much more could be. Therefore I am skeptical this is a good idea just for the representation of ?. So, I'd like other people to review the change and let me know if they think I should revert it. 2011-11-23 10:59:54 -07:00
Robby Findler
11a3d9b0ac add support for redirections to get-pure-port and add get-pure-port/headers 2011-10-03 13:21:30 -05:00
Robby Findler
1fa6129afc adjust the "Transfer-Encoding: chunked" code to re-use bytes more
agressively
2011-10-03 13:21:29 -05:00
Jon Zeppieri
d44a7a480a Moved `net/url' code from unit to module. 2011-09-05 15:22:39 -04:00
Matthew Flatt
f3da5f7fd8 adjust and document net/url HTTPS support 2011-06-20 08:00:43 -06:00
Eli Barzilay
e74f70393f Hack: make the `net/url' implementation handle both "http" and "https" urls, dispatching to the plain tcp functions or the ssl one.
(See "HACK" comment for a description on how this is done.)
2011-06-20 06:30:09 -04:00
Eli Barzilay
debd1f9f1e Recketizing much in `net/*', mass ".ss" -> ".rkt" conversion in .scrbl files.
(Some other minor things here and there.)
2011-06-20 04:27:14 -04:00
Robby Findler
e8eea05afc rewrote uses of mzlib/contract into racket/contract
(and other minor rackety when the occasion arose)
2011-03-31 18:21:11 -05:00
Matthew Flatt
28b4043077 rename all files .ss -> .rkt 2010-04-27 16:50:15 -06:00