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

Location header not rendered to client #44

Closed
vjeantet opened this issue Sep 23, 2017 · 3 comments
Closed

Location header not rendered to client #44

vjeantet opened this issue Sep 23, 2017 · 3 comments

Comments

@vjeantet
Copy link
Contributor

Hello,

When i set Location: http://google.fr in Headers panel, this header never write out to the client.
the : seems to cause the issue, because when i set `Location: http//google.fr' it works

@vjeantet
Copy link
Contributor Author

this helps

diff --git a/response.go b/response.go
index 70d3d14..0a6d5dd 100644
--- a/response.go
+++ b/response.go
@@ -96,7 +96,7 @@ func NewResponse(status, headers, body string) (*Response, error) {
                        continue
                }
 
-               kv := strings.Split(line, ":")
+               kv := strings.SplitN(line, ":", 2)
                if len(kv) != 2 {
                        continue
                }

vjeantet added a commit to vjeantet/httplab that referenced this issue Sep 23, 2017
@qustavo
Copy link
Owner

qustavo commented Sep 24, 2017

Good catch. it would be great if you could open a PR with that change.

@qustavo
Copy link
Owner

qustavo commented Sep 24, 2017

oh I didn't notice that you already did #45 😆

@qustavo qustavo closed this as completed Sep 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants