Commit Graph

45 Commits

Author SHA1 Message Date
Daniel Firsht ee8450036e Added option to disable path normalization (#649) 2019-09-18 08:56:18 +02:00
Erik Dubbelboer 2edabf3b76 Add support for user:pass in URLs (#614)
Fixes #609
2019-08-18 11:23:33 +02:00
Kirill Danshin 4a16377d6e Merge pull request #303 from chebyrash/master
Typo fixes
2018-08-13 23:18:55 +03:00
Aliaksandr Valialkin e2ac397815 Parse bogus uris with missing slash after hostname like http://foobar.com?baz=123, since such uris occur in real life :( 2017-11-08 13:05:29 +02:00
xPushkin f24d00fcc6 A lot of typo fixes 2017-10-08 13:30:35 +01:00
Aliaksandr Valialkin d257ae60a3 ioptimized decodeArgAppend a bit
Benchmark results on linux/amd64:

name                           old time/op  new time/op  delta
ArgsParse-4                    72.8ns ± 2%  68.0ns ± 2%  -6.59%  (p=0.000 n=10+9)
AppendUnquotedArgFastPath-4    20.4ns ± 2%  21.1ns ± 9%    ~     (p=0.614 n=8+10)
AppendUnquotedArgSlowPath-4    68.9ns ± 3%  70.4ns ± 6%    ~     (p=0.148 n=9+10)
URIParsePath-4                 80.9ns ± 2%  78.7ns ± 2%  -2.80%  (p=0.000 n=10+10)
URIParsePathQueryString-4      88.9ns ± 1%  86.3ns ± 1%  -2.90%  (p=0.000 n=10+8)
URIParsePathQueryStringHash-4  95.7ns ± 8%  91.0ns ± 1%  -4.88%  (p=0.000 n=9+10)
URIParseHostname-4             98.6ns ± 1%  95.4ns ± 1%  -3.24%  (p=0.000 n=10+10)
2017-07-21 16:08:21 +03:00
Aliaksandr Valialkin 0a7f0a797c Updated tests and documentation for URI.Parse and URI.Update* regarding uris without scheme 2017-01-09 10:50:56 +02:00
Aliaksandr Valialkin 2662f2e1f4 Allow redirecting to urls without scheme, i.e. //google.com/foo.bar 2016-08-17 18:55:32 +03:00
Aliaksandr Valialkin d055141f64 Propagate 'https' scheme to request URI for TLS connections 2016-08-17 14:01:35 +03:00
Aliaksandr Valialkin 033bb40f06 Properly handle hashes and single dots in URI.Update (see https://github.com/kataras/iris/issues/173) 2016-06-07 13:30:03 +03:00
Aleksandr Razumov 5e1bdcae2d Issue #86: Fixed leading slash on Windows 2016-05-04 10:07:11 +03:00
Aliaksandr Valialkin 8280b7a162 Moved empty noCopy struct to the top of container structs. See @stemar94 's comment at https://github.com/golang/go/issues/12884 for details 2016-03-06 00:17:08 +02:00
Aliaksandr Valialkin 9f43aa1601 Do not expose noCopy.Lock 2016-03-04 21:20:52 +02:00
Aliaksandr Valialkin 9fa69c74af Embed noCopy struct into structs, which mustn't be copied
This should help `go vet` detecting invalid structs' copyings.
See https://github.com/golang/go/issues/8005#issuecomment-190753527 for details.
2016-03-04 16:57:24 +02:00
Aliaksandr Valialkin 58e4dea85d Properly copy query arguments in URI.CopyTo 2016-02-19 20:17:37 +02:00
Aliaksandr Valialkin be49d3027a Allow updating request's RequestURI and Host header via Request.URI() 2016-02-19 18:53:13 +02:00
Aliaksandr Valialkin 5a26dcce53 Added AcquireArgs and ReleaseArgs helper functions 2016-02-19 12:53:39 +02:00
Aliaksandr Valialkin e1488d9349 Consistency fix: refer to URI as u instead of x in URI methods 2016-02-17 12:15:48 +02:00
Aliaksandr Valialkin dcd687ba8b Added AcquireURI and ReleaseURI 2016-02-17 12:10:53 +02:00
Aliaksandr Valialkin fd2887a5fc Issue #53: Clarify that the following instances mustn't be used from concurrently running goroutines: Args, Cookie, URI, RequestCtx, Request, Response, RequestHeader and ResponseHeader 2016-02-17 11:45:21 +02:00
Aliaksandr Valialkin 5507d704f9 Issue #48: added more tests and code prettifying after PR #50 2016-02-09 20:16:23 +02:00
Kristoffer Peterhänsel 2e947c76e1 Fix fragment parsing so it won't get url encoded if there is no query in front of it 2016-02-09 14:17:56 +01:00
Aliaksandr Valialkin 52ddf98cfd Fixed golint warnings 2016-01-19 12:43:23 +02:00
Aliaksandr Valialkin 9b0b87c951 Added URI.LastPathSegment helper function 2016-01-04 14:23:07 +02:00
Aliaksandr Valialkin e4ed4ab3c0 Moved appendQuotedPath to bytesconv 2015-12-23 11:22:14 +02:00
Aliaksandr Valialkin ea8a7f54d5 Do not escape '-' and '_' in url path and query args 2015-12-22 20:18:19 +02:00
Aliaksandr Valialkin b3c0a2cf75 Do not escape the most frequently used chars in uri path such as ':~=,' 2015-12-22 20:13:45 +02:00
Aliaksandr Valialkin 5ff6be8fee Substitute AppendBytesStr by append() 2015-12-19 20:38:10 +02:00
Aliaksandr Valialkin ddfa9f5dc0 Clarify Append* return values 2015-12-19 20:29:17 +02:00
Aliaksandr Valialkin ed1d21e27d Remove '/./' parts from path 2015-12-03 19:00:24 +02:00
Aliaksandr Valialkin 1e26cafa01 Properly copy Request.uri and Request.postArgs 2015-11-29 12:11:12 +02:00
Aliaksandr Valialkin 9f27e4c2b0 Added Update and CopyTo methods to URI 2015-11-28 14:45:13 +02:00
Aliaksandr Valialkin 46ac549ae1 Access URI members via accessors 2015-11-22 13:05:24 +02:00
Aliaksandr Valialkin 82811d58f6 Added AppendBytes and WriteTo to URI 2015-11-22 06:39:06 +02:00
Aliaksandr Valialkin a862d8592a Documentation update 2015-11-22 06:33:58 +02:00
Aliaksandr Valialkin 2b1eca3a70 Optimize request uri parsing - defer Host header reading 2015-11-19 15:05:27 +02:00
Aliaksandr Valialkin 48c0f89ee7 Added Stringer implementations to URI, Args and Cookie 2015-11-19 12:51:34 +02:00
Aliaksandr Valialkin 835bf87605 API consistency: Clear -> Reset to be consistent with standard go packages 2015-11-18 17:55:28 +02:00
Aliaksandr Valialkin f86ba6d4ea Access requestURI via RequestURI accessor 2015-11-16 16:25:09 +02:00
Aliaksandr Valialkin 230a396384 Hide URI.QueryArgs behind accessor, which automatically parses query args 2015-11-15 23:51:13 +02:00
Aliaksandr Valialkin f1f78f0828 Hide Request.URI and Request.PostArgs behind accessors, which automatically call parse URI and PostArgs on first access 2015-11-15 23:47:22 +02:00
Aliaksandr Valialkin 4edb6bacf4 Use QueryString contents if QueryArgs is empty in URI.AppendBytes 2015-10-27 19:01:21 +02:00
Aliaksandr Valialkin e9d6d7f561 Document Request, Response, RequestHeader, ResponseHeader, URI and Args 2015-10-23 15:56:12 +03:00
Aliaksandr Valialkin ffc2b7025d Added URI path normalization, i.e. //foo//../bar converts to /foo/bar 2015-10-22 17:50:47 +03:00
Aliaksandr Valialkin a049630bca initial commit 2015-10-19 01:21:09 +03:00