Skip to content

Commit ae0274c

Browse files
authored
Add iOS 18 support (#360)
1 parent 89aea97 commit ae0274c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

helper/helper.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -141,15 +141,15 @@ func GuessSupportedFormat(header *fasthttp.RequestHeader) map[string]bool {
141141
supported["jxl"] = true
142142
}
143143

144-
supportedWebPs := []string{"iPhone OS 14", "CPU OS 14", "iPhone OS 15", "CPU OS 15", "iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17"}
144+
supportedWebPs := []string{"iPhone OS 14", "CPU OS 14", "iPhone OS 15", "CPU OS 15", "iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17", "iPhone OS 18", "CPU OS 18"}
145145
for _, version := range supportedWebPs {
146146
if strings.Contains(ua, version) {
147147
supported["webp"] = true
148148
break
149149
}
150150
}
151151

152-
supportedAVIFs := []string{"iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17"}
152+
supportedAVIFs := []string{"iPhone OS 16", "CPU OS 16", "iPhone OS 17", "CPU OS 17", "iPhone OS 18", "CPU OS 18"}
153153
for _, version := range supportedAVIFs {
154154
if strings.Contains(ua, version) {
155155
supported["avif"] = true
@@ -160,7 +160,7 @@ func GuessSupportedFormat(header *fasthttp.RequestHeader) map[string]bool {
160160
// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Safari/605.1.15 <- iPad
161161
// Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.3.1 Safari/605.1.15 <- Mac
162162
// Mozilla/5.0 (iPhone; CPU iPhone OS 17_4 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/17.4 Mobile/15E148 Safari/604.1 <- iPhone @ Safari
163-
supportedJXLs := []string{"iPhone OS 17", "CPU OS 17", "Version/17"}
163+
supportedJXLs := []string{"iPhone OS 17", "CPU OS 17", "Version/17", "iPhone OS 18", "CPU OS 18", "Version/18"}
164164
if strings.Contains(ua, "iPhone") || strings.Contains(ua, "Macintosh") {
165165
for _, version := range supportedJXLs {
166166
if strings.Contains(ua, version) {

0 commit comments

Comments
 (0)