@@ -372,41 +372,7 @@ static apr_status_t deflate_ctx_cleanup(void *data)
372372 ctx -> libz_end_func (& ctx -> stream );
373373 return APR_SUCCESS ;
374374}
375- /* ETag must be unique among the possible representations, so a change
376- * to content-encoding requires a corresponding change to the ETag.
377- * This routine appends -transform (e.g., -gzip) to the entity-tag
378- * value inside the double-quotes if an ETag has already been set
379- * and its value already contains double-quotes. PR 39727
380- */
381- static void deflate_check_etag (request_rec * r , const char * transform )
382- {
383- const char * etag = apr_table_get (r -> headers_out , "ETag" );
384- apr_size_t etaglen ;
385-
386- if ((etag && ((etaglen = strlen (etag )) > 2 ))) {
387- if (etag [etaglen - 1 ] == '"' ) {
388- apr_size_t transformlen = strlen (transform );
389- char * newtag = apr_palloc (r -> pool , etaglen + transformlen + 2 );
390- char * d = newtag ;
391- char * e = d + etaglen - 1 ;
392- const char * s = etag ;
393-
394- for (; d < e ; ++ d , ++ s ) {
395- * d = * s ; /* copy etag to newtag up to last quote */
396- }
397- * d ++ = '-' ; /* append dash to newtag */
398- s = transform ;
399- e = d + transformlen ;
400- for (; d < e ; ++ d , ++ s ) {
401- * d = * s ; /* copy transform to newtag */
402- }
403- * d ++ = '"' ; /* append quote to newtag */
404- * d = '\0' ; /* null terminate newtag */
405375
406- apr_table_setn (r -> headers_out , "ETag" , newtag );
407- }
408- }
409- }
410376static apr_status_t deflate_out_filter (ap_filter_t * f ,
411377 apr_bucket_brigade * bb )
412378{
@@ -604,7 +570,6 @@ static apr_status_t deflate_out_filter(ap_filter_t *f,
604570 }
605571 apr_table_unset (r -> headers_out , "Content-Length" );
606572 apr_table_unset (r -> headers_out , "Content-MD5" );
607- deflate_check_etag (r , "gzip" );
608573
609574 /* initialize deflate output buffer */
610575 ctx -> stream .next_out = ctx -> buffer ;
@@ -1097,7 +1062,6 @@ static apr_status_t inflate_out_filter(ap_filter_t *f,
10971062 /* these are unlikely to be set anyway, but ... */
10981063 apr_table_unset (r -> headers_out , "Content-Length" );
10991064 apr_table_unset (r -> headers_out , "Content-MD5" );
1100- deflate_check_etag (r , "gunzip" );
11011065
11021066 /* initialize inflate output buffer */
11031067 ctx -> stream .next_out = ctx -> buffer ;
0 commit comments