Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(api): add extra form content type and extract endpoints from path #2592

Merged
merged 1 commit into from
Nov 9, 2022
Merged

Conversation

leoujz
Copy link
Contributor

@leoujz leoujz commented Nov 9, 2022

api gateway:

  • handing http request adds Content-Type application/x-www-form-urlencoded support
  • extract endpoints from path if no endpoint matched, only in api case

…form-urlencoded, and extract endpoints from path if no endpoint matched
@Davincible
Copy link
Contributor

Nice!

Could you explain a bit how the endpoint extraction works?

If I'm not mistaken it now limits you to only have one slash in your URL for your method

@leoujz
Copy link
Contributor Author

leoujz commented Nov 9, 2022

The original code use rsp.Method as the endpoint name. As the strategy mentioned in https://github.com/go-micro/api, I extract the endpoint name from rsp.Path. If any endpoint matched before this code, this would never happen, this only runs when no endpoint mathced, as a final default value. when using rsp.Method, like POST, GET, would never work.

@leoujz
Copy link
Contributor Author

leoujz commented Nov 9, 2022

And 3 failing checks relative to my code? I don't know how to fix that

@Davincible
Copy link
Contributor

Makes sense, thanks for the PR!

Checks are not relative to your change.

@Davincible Davincible changed the title api gateway handing http request adds Content-Type application/x-www-… feat(api): add extra form content type and extract endpoints from path Nov 9, 2022
@Davincible Davincible merged commit 0a91ba7 into micro:master Nov 9, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants