Insomnia: [Question] Escaping {% and %}

Created on 15 Jul 2019  路  5Comments  路  Source: Kong/insomnia

  • Insomnia Version: 6.5.4
  • Operating System: Windows 10 v1903

Details

I'm debugging a web service that stores URL-encoded JSON in one of its cookies. Yes I know that's awful, but that's Parse.ly's decision, not mine.

The problem is now I have a cookie that looks like this:

_parsely_visitor={%22id%22:%22pid=70617273656c79207375636b73%22%2C%22session_count%22:244%2C%22last_session_ts%22:1559156958078}

and that {% trips up Insomnia's template engine.

unknown block tag: 22id

I've tried wrapping the cookie string with {% raw %} and {% endraw %} but this seems to have no effect.

stale

Most helpful comment

Dang, didn't mean to let this close. I would really appreciate a per-request or per-workspace option to disable rendering cookies.

All 5 comments

馃憢 Thanks for opening your first issue! If you're reporting a 馃悶 bug, please make sure
you include steps to reproduce it. If you're requesting a feature 馃巵, please provide real
use cases that would benefit. 馃應

To help make this a smooth process, please be sure you have first read the
contributing guidelines.

Hmm, this is a tricky one. The reason the raw/endraw tags don't work is probably because Insomnia may render parts of the request multiple times depending on what it's doing. So, the first render will remove the raw/endraw tags and the next render will render what they used to surround.

Unfortunately there's no workaround for this that I can think of at the moment but maybe we could add a setting (global or per-request) to disable rendering of cookies. We already have a per-request setting to disable rendering of request bodies in for similar reasons.

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

Dang, didn't mean to let this close. I would really appreciate a per-request or per-workspace option to disable rendering cookies.

Hi, I recently ran into this issue with a cookie being set in Insomnia by a site I'm testing requests against that contains URL-encoded JSON as well. I have to delete the cookie between every request, otherwise the next one fails with the "failed to render Request.cookies[2].valuie prior to sending" error.

Perhaps Insomnia could at least be set to not try to to render cookies that weren't set by the user with template strings. I don't think there's any reason to expect cookies set by a site would want to be using template variables set explicitly in Insomnia

Was this page helpful?
0 / 5 - 0 ratings