> It might be better to create a module level static variable of type
*ngx_string* with *"x-amz-date"* as its value
ok I will change this.



2013/11/30 Arvind Jayaprakash <notifications@github.com>

> In ngx_http_aws_auth.c:
>
> > +        }
> > +    }
> > +
> > +    aws_conf = ngx_http_get_module_loc_conf(r, ngx_http_aws_auth_module);
> > +    if (aws_conf->add_date) {
> > +        h = ngx_array_push(v);
> > +        if (h == NULL) {
> > +            return NGX_ERROR;
> > +        }
> > +        u_char * name = ngx_palloc(r->pool, sizeof("x-amz-date"));
> > +        u_char * val  = ngx_palloc(r->pool, ngx_cached_http_time.len + 1);
> > +
> > +        ngx_memcpy(name, (u_char *)"x-amz-date", sizeof("x-amz-date")-1);
> > +        ngx_memcpy(val, ngx_cached_http_time.data, ngx_cached_http_time.len);
> > +        h->key.data = name;
> > +        h->key.len  = sizeof("x-amz-date")-1;
>
> It might be better to create a module level static variable of type
> *ngx_string* with *"x-amz-date"* as its value. We can then have reuse the
> *u_char** and the *length* fields throughout the module
>
> —
> Reply to this email directly or view it on GitHub<https://github.com/anomalizer/ngx_aws_auth/pull/5/files#r8010316>
> .
>



-- 
Pozdrawiam
Dominik