Skip to content
Snippets Groups Projects
Commit 84e61472 authored by Silvan's avatar Silvan
Browse files

fix kugou for ios 7.0.20

parent 9bdaec1c
No related branches found
Tags 0.2.0
No related merge requests found
......@@ -136,9 +136,6 @@ func Request(clientRequest *ClientRequest) (*http.Response, error) {
fmt.Printf("http.Client.Do fail:%v\n", err)
return resp, err
}
if host == "tyst.migu.cn" && resp.StatusCode == 200 && len(request.Header.Get("range")) > 0 {
resp.StatusCode = 206
}
return resp, err
......
......@@ -76,6 +76,11 @@ func (h *HttpHandler) ServeHTTP(resp http.ResponseWriter, request *http.Request)
for name, values := range response.Header {
resp.Header()[name] = values
}
//fix ios 7.0.20
resp.Header().Del("Keep-Alive")
if response.StatusCode == 200 && (len(request.Header.Get("range")) > 0 || len(response.Header.Get("content-range")) > 0) {
response.StatusCode = 206
}
resp.WriteHeader(response.StatusCode)
_, err = io.Copy(resp, response.Body)
if err != nil {
......
......@@ -24,13 +24,13 @@ func GetGoVersion() string {
}
func AppVersion() string {
return fmt.Sprintf(`
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## #### ## ## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## ## ## ## ## ## ## ## ##
## ## ## ## ## #### ## ## ## ## ## ## ## ## ## ## ## ## ## ##
%s`+" by cnsilvan(https://github.com/cnsilvan/UnblockNeteaseMusic) \n", Version)
%s`+" by cnsilvan(https://github.com/cnsilvan/UnblockNeteaseMusic) \n", Version)
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment