@@ -131,71 +131,76 @@ func pair(name, value string) HeaderField {
131
131
132
132
// http://tools.ietf.org/html/draft-ietf-httpbis-header-compression-07#appendix-B
133
133
var staticTable = newStaticTable ()
134
+ var staticTableEntries = [... ]HeaderField {
135
+ pair (":authority" , "" ),
136
+ pair (":method" , "GET" ),
137
+ pair (":method" , "POST" ),
138
+ pair (":path" , "/" ),
139
+ pair (":path" , "/index.html" ),
140
+ pair (":scheme" , "http" ),
141
+ pair (":scheme" , "https" ),
142
+ pair (":status" , "200" ),
143
+ pair (":status" , "204" ),
144
+ pair (":status" , "206" ),
145
+ pair (":status" , "304" ),
146
+ pair (":status" , "400" ),
147
+ pair (":status" , "404" ),
148
+ pair (":status" , "500" ),
149
+ pair ("accept-charset" , "" ),
150
+ pair ("accept-encoding" , "gzip, deflate" ),
151
+ pair ("accept-language" , "" ),
152
+ pair ("accept-ranges" , "" ),
153
+ pair ("accept" , "" ),
154
+ pair ("access-control-allow-origin" , "" ),
155
+ pair ("age" , "" ),
156
+ pair ("allow" , "" ),
157
+ pair ("authorization" , "" ),
158
+ pair ("cache-control" , "" ),
159
+ pair ("content-disposition" , "" ),
160
+ pair ("content-encoding" , "" ),
161
+ pair ("content-language" , "" ),
162
+ pair ("content-length" , "" ),
163
+ pair ("content-location" , "" ),
164
+ pair ("content-range" , "" ),
165
+ pair ("content-type" , "" ),
166
+ pair ("cookie" , "" ),
167
+ pair ("date" , "" ),
168
+ pair ("etag" , "" ),
169
+ pair ("expect" , "" ),
170
+ pair ("expires" , "" ),
171
+ pair ("from" , "" ),
172
+ pair ("host" , "" ),
173
+ pair ("if-match" , "" ),
174
+ pair ("if-modified-since" , "" ),
175
+ pair ("if-none-match" , "" ),
176
+ pair ("if-range" , "" ),
177
+ pair ("if-unmodified-since" , "" ),
178
+ pair ("last-modified" , "" ),
179
+ pair ("link" , "" ),
180
+ pair ("location" , "" ),
181
+ pair ("max-forwards" , "" ),
182
+ pair ("proxy-authenticate" , "" ),
183
+ pair ("proxy-authorization" , "" ),
184
+ pair ("range" , "" ),
185
+ pair ("referer" , "" ),
186
+ pair ("refresh" , "" ),
187
+ pair ("retry-after" , "" ),
188
+ pair ("server" , "" ),
189
+ pair ("set-cookie" , "" ),
190
+ pair ("strict-transport-security" , "" ),
191
+ pair ("transfer-encoding" , "" ),
192
+ pair ("user-agent" , "" ),
193
+ pair ("vary" , "" ),
194
+ pair ("via" , "" ),
195
+ pair ("www-authenticate" , "" ),
196
+ }
134
197
135
198
func newStaticTable () * headerFieldTable {
136
199
t := & headerFieldTable {}
137
200
t .init ()
138
- t .addEntry (pair (":authority" , "" ))
139
- t .addEntry (pair (":method" , "GET" ))
140
- t .addEntry (pair (":method" , "POST" ))
141
- t .addEntry (pair (":path" , "/" ))
142
- t .addEntry (pair (":path" , "/index.html" ))
143
- t .addEntry (pair (":scheme" , "http" ))
144
- t .addEntry (pair (":scheme" , "https" ))
145
- t .addEntry (pair (":status" , "200" ))
146
- t .addEntry (pair (":status" , "204" ))
147
- t .addEntry (pair (":status" , "206" ))
148
- t .addEntry (pair (":status" , "304" ))
149
- t .addEntry (pair (":status" , "400" ))
150
- t .addEntry (pair (":status" , "404" ))
151
- t .addEntry (pair (":status" , "500" ))
152
- t .addEntry (pair ("accept-charset" , "" ))
153
- t .addEntry (pair ("accept-encoding" , "gzip, deflate" ))
154
- t .addEntry (pair ("accept-language" , "" ))
155
- t .addEntry (pair ("accept-ranges" , "" ))
156
- t .addEntry (pair ("accept" , "" ))
157
- t .addEntry (pair ("access-control-allow-origin" , "" ))
158
- t .addEntry (pair ("age" , "" ))
159
- t .addEntry (pair ("allow" , "" ))
160
- t .addEntry (pair ("authorization" , "" ))
161
- t .addEntry (pair ("cache-control" , "" ))
162
- t .addEntry (pair ("content-disposition" , "" ))
163
- t .addEntry (pair ("content-encoding" , "" ))
164
- t .addEntry (pair ("content-language" , "" ))
165
- t .addEntry (pair ("content-length" , "" ))
166
- t .addEntry (pair ("content-location" , "" ))
167
- t .addEntry (pair ("content-range" , "" ))
168
- t .addEntry (pair ("content-type" , "" ))
169
- t .addEntry (pair ("cookie" , "" ))
170
- t .addEntry (pair ("date" , "" ))
171
- t .addEntry (pair ("etag" , "" ))
172
- t .addEntry (pair ("expect" , "" ))
173
- t .addEntry (pair ("expires" , "" ))
174
- t .addEntry (pair ("from" , "" ))
175
- t .addEntry (pair ("host" , "" ))
176
- t .addEntry (pair ("if-match" , "" ))
177
- t .addEntry (pair ("if-modified-since" , "" ))
178
- t .addEntry (pair ("if-none-match" , "" ))
179
- t .addEntry (pair ("if-range" , "" ))
180
- t .addEntry (pair ("if-unmodified-since" , "" ))
181
- t .addEntry (pair ("last-modified" , "" ))
182
- t .addEntry (pair ("link" , "" ))
183
- t .addEntry (pair ("location" , "" ))
184
- t .addEntry (pair ("max-forwards" , "" ))
185
- t .addEntry (pair ("proxy-authenticate" , "" ))
186
- t .addEntry (pair ("proxy-authorization" , "" ))
187
- t .addEntry (pair ("range" , "" ))
188
- t .addEntry (pair ("referer" , "" ))
189
- t .addEntry (pair ("refresh" , "" ))
190
- t .addEntry (pair ("retry-after" , "" ))
191
- t .addEntry (pair ("server" , "" ))
192
- t .addEntry (pair ("set-cookie" , "" ))
193
- t .addEntry (pair ("strict-transport-security" , "" ))
194
- t .addEntry (pair ("transfer-encoding" , "" ))
195
- t .addEntry (pair ("user-agent" , "" ))
196
- t .addEntry (pair ("vary" , "" ))
197
- t .addEntry (pair ("via" , "" ))
198
- t .addEntry (pair ("www-authenticate" , "" ))
201
+ for _ , e := range staticTableEntries [:] {
202
+ t .addEntry (e )
203
+ }
199
204
return t
200
205
}
201
206
0 commit comments