Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
880beafc
Commit
880beafc
authored
Jul 12, 2010
by
Andrew Gerrand
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
http: fix ParseURL to handle //relative_path properly
Fixes #900. R=rsc CC=golang-dev
https://golang.org/cl/1756042
parent
97bcf049
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
1 deletion
+12
-1
url.go
src/pkg/http/url.go
+1
-1
url_test.go
src/pkg/http/url_test.go
+11
-0
No files found.
src/pkg/http/url.go
View file @
880beafc
...
...
@@ -318,7 +318,7 @@ func ParseURL(rawurl string) (url *URL, err os.Error) {
}
// Maybe path is //authority/path
if
len
(
path
)
>
2
&&
path
[
0
:
2
]
==
"//"
{
if
url
.
Scheme
!=
""
&&
len
(
path
)
>
2
&&
path
[
0
:
2
]
==
"//"
{
url
.
Authority
,
path
=
split
(
path
[
2
:
],
'/'
,
false
)
}
url
.
RawPath
=
path
+
query
...
...
src/pkg/http/url_test.go
View file @
880beafc
...
...
@@ -174,6 +174,17 @@ var urltests = []URLTest{
},
""
,
},
// leading // without scheme shouldn't create an authority
URLTest
{
"//foo"
,
&
URL
{
Raw
:
"//foo"
,
Scheme
:
""
,
RawPath
:
"//foo"
,
Path
:
"//foo"
,
},
""
,
},
}
var
urlnofragtests
=
[]
URLTest
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment