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

🐛 Fix: ctx.BodyParser was not able to parse vendor specific content type #1506

Conversation

shirshendubhowmick
Copy link
Contributor

@shirshendubhowmick shirshendubhowmick commented Aug 22, 2021

Please provide enough information so that others can review your pull request:

ctx.BodyParser was not able to parse vendor specific content types like application/vnd.api+json; version=1 even though its a valid type of JSON

Explain the details for making this change. What existing problem does the pull request solve?

This solves #1505

Benchmark details related to this change

Running tool: /usr/local/go/bin/go test -benchmem -run=^$ -bench ^(Benchmark_ParseVendorSpecificContentType)$ github.com/gofiber/fiber/v2/utils

goos: darwin
goarch: amd64
pkg: github.com/gofiber/fiber/v2/utils
cpu: Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
Benchmark_ParseVendorSpecificContentType/vendorContentType-12         	23002122	        52.34 ns/op	      16 B/op	       1 allocs/op
Benchmark_ParseVendorSpecificContentType/defaultContentType-12        	175375113	         6.869 ns/op	       0 B/op	       0 allocs/op
PASS
ok  	github.com/gofiber/fiber/v2/utils	4.599s

Commit formatting

Use emojis on commit messages so it provides an easy way of identifying the purpose or intention of a commit. Check out the emoji cheatsheet here: https://gitmoji.carloscuesta.me/

@welcome
Copy link

welcome bot commented Aug 22, 2021

Thanks for opening this pull request! 🎉 Please check out our contributing guidelines. If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

Copy link
Member

@ReneWerner87 ReneWerner87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, could you please add a benchmark?

@shirshendubhowmick shirshendubhowmick force-pushed the shirshendu/fix-bodyparser-mime-parsing branch from ad4066b to f942931 Compare August 22, 2021 14:46
@shirshendubhowmick
Copy link
Contributor Author

Looks good, could you please add a benchmark?

@ReneWerner87 Done.

@ReneWerner87
Copy link
Member

Can you please post the output of the benchmark in the pull request so we can see what the values are and have them noted for later here

@shirshendubhowmick
Copy link
Contributor Author

shirshendubhowmick commented Aug 22, 2021

Can you please post the output of the benchmark in the pull request so we can see what the values are and have them noted for later here

Yeah sure, I have edited the PR description and added the benchmark details. Also there was a typo in the benchmark name, have fixed it.

@shirshendubhowmick shirshendubhowmick force-pushed the shirshendu/fix-bodyparser-mime-parsing branch from f942931 to f46e89b Compare August 22, 2021 15:02
@ReneWerner87 ReneWerner87 merged commit d892078 into gofiber:master Aug 22, 2021
@welcome
Copy link

welcome bot commented Aug 22, 2021

Congrats on merging your first pull request! 🎉 We here at Fiber are proud of you! If you need help or want to chat with us, join us on Discord https://gofiber.io/discord

@shirshendubhowmick shirshendubhowmick deleted the shirshendu/fix-bodyparser-mime-parsing branch August 22, 2021 17:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants