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

add support for 206 status #8

Open
horpto opened this issue Aug 12, 2016 · 9 comments
Open

add support for 206 status #8

horpto opened this issue Aug 12, 2016 · 9 comments

Comments

@horpto
Copy link
Owner

horpto commented Aug 12, 2016

No description provided.

@randunel
Copy link

Have you encountered a 206 status? Is there a relatively succinct way of reproducing or testing it?

@horpto
Copy link
Owner Author

horpto commented Aug 18, 2016

@randunel
Hi, now nodecap2 are not supported 206 as this feature is not needed for our product, but I think to make it to version 3.0 or maybe earlier.
I have not encountered with 206 status. You can try to check c-icap.

@randunel
Copy link

@horpto I know nodecap2 doesn't support 206 status codes as icap codes, but i'm wondering whether it should be supported at all.

I've got a separate node.js icap project and I was wondering whether 206 is needed at all, since I've never encountered it so far, hence I haven't implemented it :P

@horpto
Copy link
Owner Author

horpto commented Aug 18, 2016

@randunel
In RESPMOD I download html page (other mimes I pass) entirely or first 20 Mb (yeah, I have requirement to not crash at big html pages) and then filter it.
Some forks of nodecap2 are supported 206, I don't know for what. https://github.com/horpto/nodecap2/network

@anton-zaharov
Copy link

I installed package and started example/modify_html.js
then i visited simple static page and saw:

but page was not loaded in browser, response was not reseived...
i put code
console.info('I am in filter function');
to icapRes.setFilter callback, and not saw this console output, code never reach...

squid -v
Squid Cache: Version 3.5.20
Service Name: squid

tail /etc/squid/squid.conf
icap_enable on
icap_preview_size 4096

#icap_service service_req reqmod_precache bypass=1 icap://127.0.0.1:1344/request
#adaptation_access service_req allow all

icap_service service_resp respmod_precache bypass=0 icap://127.0.0.1:1344/response
adaptation_access service_resp allow all

Please, help me find what is wrong

@horpto
Copy link
Owner Author

horpto commented Feb 1, 2019

Hi @anton-zaharov
Thanks for bugreport. Actually it's better to create a new issue with your question.
Also you can try to find me in the gitter of repo.

I am afraid examples is not in the best state and can be broken. I'll try to help you.

@horpto
Copy link
Owner Author

horpto commented Feb 1, 2019

@anton-zaharov can you add a console.log in (1) the beginning of acceptRequest, (2) the beginning server.response('*', function(icapReq, icapRes, req, res, next) {, line 66, and (3) before icapRes.setFilter ?
what's output in this case?

Also master branch has some new changes and I need a bit of time to sort out it, check the examples, and release new version - 2.3.0 or 3.0.0, don't know.

@horpto
Copy link
Owner Author

horpto commented Feb 1, 2019

@anton-zaharov
workaround: add icapRes.hasBody = true after icapRes.continuePreview();, (line ~100)

@anton-zaharov
Copy link

Thanks, now test works correctly

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

No branches or pull requests

3 participants