Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

net/http: can't send star request #11202

Closed
dvyukov opened this issue Jun 13, 2015 · 2 comments
Closed

net/http: can't send star request #11202

dvyukov opened this issue Jun 13, 2015 · 2 comments
Milestone

Comments

@dvyukov
Copy link
Member

dvyukov commented Jun 13, 2015

The following program fails with the panic:

package main

import (
    "bufio"
    "bytes"
    "net/http"
)

func main() {
    data := []byte("M-SEARCH * HTTP/1.1\n\n")
    r, err := http.ReadRequest(bufio.NewReader(bytes.NewReader(data)))
    if err != nil {
        return
    }
    buf := new(bytes.Buffer)
    if err := r.Write(buf); err != nil {
        return
    }
    _, err = http.ReadRequest(bufio.NewReader(buf))
    if err != nil {
        panic(err)
    }
}
panic: parse %2A: invalid URI for request

Star is a common path for some request types. It is handled by a special path in URL.Parse, but URL.String generated %2A for it, which is an invalid path.

go version devel +a1fe3b5 Sat Jun 13 04:33:26 2015 +0000 linux/amd64

@ianlancetaylor ianlancetaylor added this to the Go1.5Maybe milestone Jun 13, 2015
@mikioh
Copy link
Contributor

mikioh commented Jun 13, 2015

See #5684.

@gopherbot
Copy link
Contributor

CL https://golang.org/cl/11492 mentions this issue.

@mikioh mikioh modified the milestones: Go1.5, Go1.5Maybe Jun 27, 2015
@golang golang locked and limited conversation to collaborators Jun 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants