Avoid buffer overflow with strncpy.

As mentioned in #3 the size of req.filename is 512 and url is twice the size. Strncpy is the better choice here.