Skip to content

Commit

Permalink
fix: ipa plist key
Browse files Browse the repository at this point in the history
  • Loading branch information
xhofe committed Mar 5, 2022
1 parent b44243c commit 3ccf5ee
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions server/controllers/other.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ func Plist(c *gin.Context) {
name := utils.Base(u)
u = uUrl.String()
ipaIndex := strings.Index(name, ".ipa")
decodeName := name
if ipaIndex != -1 {
name = name[:ipaIndex]
decodeName, err := url.PathUnescape(name)
decodeName = name
tmp, err := url.PathUnescape(name)
if err == nil {
name = decodeName
decodeName = tmp
}
}
name = strings.ReplaceAll(name, "<", "[")
Expand Down Expand Up @@ -71,7 +73,7 @@ func Plist(c *gin.Context) {
</dict>
</array>
</dict>
</plist>`, u, name, name)
</plist>`, u, name, decodeName)
c.Header("Content-Type", "application/xml;charset=utf-8")
c.Status(200)
_, _ = c.Writer.WriteString(plist)
Expand Down

0 comments on commit 3ccf5ee

Please sign in to comment.