PsychoTea / Oxide.Ext.Discord

Discord extension and integration
https://umod.org/extensions/discord
12 stars 25 forks source link

Fix for PUT WebRequests #48

Closed features-not-bugs closed 5 years ago

features-not-bugs commented 5 years ago

Content-Length was ommitted for certain put requests, e.g; Guild.AddGuildMemberRole(...)

Content-Length is now a default set to 0 by default (This is overridden if data != null)

Discord API was returning an error complaining about Content-Length not being set for any Request MethodType != GET. Even if the payload was empty, the API still wanted to know through a header. If data == null, the WriteRequestData method would never set Content-Length to 0.

Also changed WriteRequestData to start using the object param instead of instance field. OCD was ticking..

features-not-bugs commented 5 years ago

Bump bump.