@@ -96,13 +96,21 @@ extension Shared {
96
96
97
97
// convenience constructors
98
98
public extension Shared . ContentType {
99
+ /// AAC audio
100
+ static let aac : Self = . init( . aac)
101
+ /// Audio Video Interleave
102
+ static let avi : Self = . init( . avi)
99
103
/// Bitmap image
100
104
static let bmp : Self = . init( . bmp)
101
105
static let css : Self = . init( . css)
102
106
/// Comma-separated values
103
107
static let csv : Self = . init( . csv)
108
+ static let doc : Self = . init( . doc)
109
+ static let docx : Self = . init( . docx)
104
110
/// URL-encoded form data. See also: `multipartForm`.
105
111
static let form : Self = . init( . form)
112
+ /// Graphics Interchange Format
113
+ static let gif : Self = . init( . gif)
106
114
static let html : Self = . init( . html)
107
115
static let javascript : Self = . init( . javascript)
108
116
/// JPEG image
@@ -161,13 +169,21 @@ extension Shared.ContentType {
161
169
// This internal representation makes it easier to ensure that the popular
162
170
// builtin types supported are fully covered in their rawValue implementation.
163
171
internal enum Builtin : Codable , Equatable , Hashable {
172
+ /// AAC audio
173
+ case aac
174
+ /// Audio Video Interleave
175
+ case avi
164
176
/// Bitmap image
165
177
case bmp
166
178
case css
167
179
/// Comma-separated values
168
180
case csv
181
+ case doc
182
+ case docx
169
183
/// URL-encoded form data. See also: `multipartForm`.
170
184
case form
185
+ /// Graphics Interchange Format
186
+ case gif
171
187
case html
172
188
case javascript
173
189
/// JPEG image
@@ -226,10 +242,15 @@ extension Shared.ContentType {
226
242
extension Shared . ContentType . Builtin : RawRepresentable {
227
243
public var rawValue : String {
228
244
switch self {
245
+ case . aac: return " audio/aac "
246
+ case . avi: return " video/x-msvideo "
229
247
case . bmp: return " image/bmp "
230
248
case . css: return " text/css "
231
249
case . csv: return " text/csv "
250
+ case . doc: return " application/msword "
251
+ case . docx: return " application/vnd.openxmlformats-officedocument.wordprocessingml.document "
232
252
case . form: return " application/x-www-form-urlencoded "
253
+ case . gif: return " image/gif "
233
254
case . html: return " text/html "
234
255
case . javascript: return " application/javascript "
235
256
case . jpg: return " image/jpeg "
@@ -269,10 +290,15 @@ extension Shared.ContentType.Builtin: RawRepresentable {
269
290
270
291
public init ? ( rawValue: String ) {
271
292
switch rawValue {
293
+ case " audio/aac " : self = . aac
294
+ case " video/x-msvideo " : self = . avi
272
295
case " image/bmp " : self = . bmp
273
296
case " text/css " : self = . css
274
297
case " text/csv " : self = . csv
298
+ case " application/msword " : self = . doc
299
+ case " application/vnd.openxmlformats-officedocument.wordprocessingml.document " : self = . docx
275
300
case " application/x-www-form-urlencoded " : self = . form
301
+ case " image/gif " : self = . gif
276
302
case " text/html " : self = . html
277
303
case " application/javascript " : self = . javascript
278
304
case " image/jpeg " : self = . jpg
0 commit comments