I've read an article about preventing XSS attacks. it explained, Rails itself prevents some attacks. actually Rails uses ERB::Util#html_escape function to escape HTML entities.
<b>Hello <%= params[:name] %></b>
If the above is attacked with ?name=<script>alert(1)</script>, the output will be as follows:
<b> Hello <script>alert(1)</script>gt; </b>
But, when I pass this name in API mode, it doesn't work.
POSTMAN
url?name=<script>alert(1)</script>
Rails App
params[:name]
the output will be "<script>alert(1)</script>".
Does it have any config for working correctly in API mode?