← Back to team overview

libravatar-fans team mailing list archive

Re: Absence on 2018-11-25

 

Here are my thoughts.

On 2018-11-23 at 11:16:54, Tristan Le Guern wrote:
>   + ivatar returns an HTML document, the home page ;
>   + libravatar and libravatar.cgi both return the file nobody.png.

In general, I think we should always return an image. That's what the
clients are expecting.

> * What to do if the size option is supplied but has no value ?
> * What to do if the size option is supplied but the value is not an integer?
> * What to do if the size option is supplied but the value is 0 ?
> 
>   + ivatar and libravatar both return an avatar of the default size ;
>   + libravatar.cgi returns the HTTP status code 400.

I think it makes sense to do the best we can here and return something to
clients that don't do proper error-checking on their end (e.g. a piece of
software that includes Libravatar support and lets admins configure the
avatar size to any value).

> * What to do if the size option is supplied but the value is negative ?
> 
>   + ivatar crashes (issue #21) ;
>   + libravatar returns an avatar of the default size ;
>   + libravatar.cgi returns the HTTP status code 400.

I imagine ivatar will fix the crash and match the libravatar behaviour here.

> * What to do if the size option is supplied but the value is too big ?
> 
>   + ivatar returns an avatar of the maximum allowed size (512) ;
>   + libravatar returns an avatar of the requested size ;
>   + libravatar.cgi returns the HTTP status code 400.

ivatar's behaviour seems ideal here.

> * What to do if the default option is supplied but has no value ?
> * What to do if the default option is supplied but has an unhandled value
> (such as d=unicorn) ?
> 
>   + ivatar and libravatar both return the user's avatar ;
>   + libravatar.cgi returns the HTTP status code 400.

Again, I think it makes sense to do the best we can when the API is
accidentally misused by a client.

> * What to do if the default option is supplied but has an unhandled value
> (such as d=unicorn) and the forcedefault option is set to true ?
> 
>   + ivatar returns an HTML document, the home page ;
>   + libravatar doesn't implement forcedefault ;
>   + libravatar.cgi returns the HTTP status code 400.

Following the principle of being tolerant of bad configurations, I guess we
should ignore the invalid value and just use the "default" page we would use
if the "d" option wasn't specified.

> As an optional point: Should the list of possible value for the default
> option be explorable by the client ? I think an HTTP request with the
> OPTIONS verb on the /avatar resource could do the trick.

Good idea!

Francois

-- 
https://fmarier.org/


Follow ups

References