geoadmin / service-alti

Height/profile services for geo.admin.ch
Other
2 stars 2 forks source link

BGDIINF_SB-2197: Returns 415 in case of wrong content-type #93

Closed ltshb closed 2 years ago

ltshb commented 2 years ago

If the request was done with an invalid content-type, then the service returned a 400, "No 'geom' given, cannot create a profile without coordinates".

This was kind of misleading, for example when doing a request with curl without specifying the content-type (curl used application/x-www-form-urlencoded) but with valid payload.

The issue was that request.is_json in flask is set based on the content-type header and not on the payload being a valid json.

ltshb commented 2 years ago

@pakb can we remove the service-alti-python2 codebuild project, apparently we don't need to support python2 anymore and this codebuild project used anyway python 3.7.

pakb commented 2 years ago

@pakb can we remove the service-alti-python2 codebuild project, apparently we don't need to support python2 anymore and this codebuild project used anyway python 3.7.

As you are finalizing the migration to docker, that makes total sense yes. Python2 support was there only to accommodate vhost support