The generally accepted scenario for Gamma-Ray Burst (GRB) progenitors relates short bursts with the merger of compact binaries and long bursts with the collapse of massive rotating stars. In this framework, short GRBs are expected to occur preferentially in a tenuous interstellar medium, while long ones should be linked with star forming regions and should thus be characterized by a higher density environment. Within the standard fireball model, the density of the medium surrounding the burst site is a parameters which can be constrained by comparing afterglow data with the model predictions, provided the afterglow is sufficiently well-sampled with broad-band observations. Here we give an overview of the method we have set up, aimed to test the expected difference in density parameter, via a comparative study of short and long GRB afterglows. The first results, obtained for the short GRB 051221a, are presented.