spring-cloud-openfeign icon indicating copy to clipboard operation
spring-cloud-openfeign copied to clipboard

Feign converts GET request to POST if path variable has regular expression

Open vivek-nadar opened this issue 5 years ago • 6 comments
trafficstars

We have observed an issue with Feign client.

When we use regular expression in path variables to duplicate the Feign client. The GET method request is converted to POST method request.

Please find the version of the APIs used, Spring cloud Greewich.SR3 Spring boot 2.1.1.RELEASE spring-cloud-starter-openfeign

Please find the sample request mappings,

@RequestMapping(value = { "/users/{userId:\d+}", "/v1/users/{userId:\d+}" }, method = { RequestMethod.GET })

@RequestMapping(value = { "/users/{candidateKey:VMW-\d{8}\w-\d{8}}", "/v1/users/{candidateKey:VMW-\d{8}\w-\d{8}}" }, method = { RequestMethod.GET })

@RequestMapping(value = { "/users/{email:.+@.+\..+}", "/v1/users/{email:.+@.+\..+}" }, method = { RequestMethod.GET })

vivek-nadar avatar Nov 24 '19 07:11 vivek-nadar

Could you provide a minimal demo to reproduce this bug?

OLPMO avatar Dec 12 '19 12:12 OLPMO

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-projects-issues avatar Dec 23 '19 15:12 spring-projects-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-projects-issues avatar Dec 30 '19 15:12 spring-projects-issues

Also happening here. Here is my method signature (Kotlin):

    @GetMapping(path = ["/v1/kyc-files/{proxyPath:.+}"])
    fun getDocumentAttachment(
            @PathVariable("proxyPath") proxyPath: String
    ) : ResponseEntity<Resource>

alonsohki avatar Mar 31 '20 14:03 alonsohki

Could you provide a minimal demo to reproduce this bug?

Apologies since mails from GIT HUB went to spam folder.

Can you let me know if you are expecting an working program for the issue ?

Alternatively, can you add the below request mappings in any spring controllers and check since replicating the issue might take minimal effort.

@RequestMapping(value = { "/users/{userId:\d+}", "/v1/users/{userId:\d+}" }, method = { RequestMethod.GET })

@RequestMapping(value = { "/users/{candidateKey:VMW-\d{8}\w-\d{8}}", "/v1/users/{candidateKey:VMW-\d{8}\w-\d{8}}" }, method = { RequestMethod.GET })

@RequestMapping(value = { "/users/{email:.+@.+..+}", "/v1/users/{email:.+@.+..+}" }, method = { RequestMethod.GET })

Thanks & Regards

vivek-nadar avatar Mar 31 '20 14:03 vivek-nadar

Additional info: Here are the Feign logs for the request (I hid private info):

---> GET https://xxxx.execute-api.eu-west-1.vpce.amazonaws.com/v1/kyc-files/uploads/xxxx/abcdefg.png HTTP/1.1
Authorization: AWS4-HMAC-SHA256 *****
Content-Length: 78
Content-Type: application/json;charset=UTF-8
Host: xxxx.execute-api.eu-west-1.vpce.amazonaws.com
X-Amz-Date: 20200331T141505Z
x-apigw-api-id: abcdefg

{"proxyPath":"uploads/xxxx/abcdefg.png"}
---> END HTTP (78-byte body)

alonsohki avatar Mar 31 '20 14:03 alonsohki

@vivek-nadar @alonsohki. As requested by @OLPMO please provide a minimal, complete, verifiable example that reproduces the issue if you want us to look at this. First, please verify if the issue still exists on currently maintained SC OpenFeign versions (3.1.6 or 4.0.1).

OlgaMaciaszek avatar Mar 09 '23 13:03 OlgaMaciaszek

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues avatar Mar 16 '23 13:03 spring-cloud-issues

@vivek-nadar @alonsohki. As requested by @OLPMO please provide a minimal, complete, verifiable example that reproduces the issue if you want us to look at this. First, please verify if the issue still exists on currently maintained SC OpenFeign versions (3.1.6 or 4.0.1).

I am sorry but I reported this three years ago. I haven't used spring in two years. I cannot even remember what this was about.

alonsohki avatar Mar 16 '23 14:03 alonsohki

The bug is still happening here. I am using the following version: https://mvnrepository.com/artifact/org.springframework.cloud/spring-cloud-openfeign-dependencies/2.2.2.RELEASE

tonyfarney avatar Oct 04 '23 20:10 tonyfarney

@tonyfarney This version has not been supported for a very long time now. 3.1.8 and 4.0.4 are currently supported.

OlgaMaciaszek avatar Oct 05 '23 09:10 OlgaMaciaszek

If you would like us to look at this issue, please provide the requested information. If the information is not provided within the next 7 days this issue will be closed.

spring-cloud-issues avatar Oct 12 '23 09:10 spring-cloud-issues

Closing due to lack of requested feedback. If you would like us to look at this issue, please provide the requested information and we will re-open the issue.

spring-cloud-issues avatar Oct 19 '23 09:10 spring-cloud-issues