Cov txheej txheem:

Kuv yuav teeb tsa li cas rau kev tswj xyuas tso cai rau Keeb Kwm header?
Kuv yuav teeb tsa li cas rau kev tswj xyuas tso cai rau Keeb Kwm header?

Video: Kuv yuav teeb tsa li cas rau kev tswj xyuas tso cai rau Keeb Kwm header?

Video: Kuv yuav teeb tsa li cas rau kev tswj xyuas tso cai rau Keeb Kwm header?
Video: Tshuaj theem vim li cas thiaj tau nqi ?/ Siv kho mob dab tsi?/paris polyphylla use for? 2024, Kaum ib hlis
Anonim

Rau IIS6

  1. Qhib Internet Information Service (IIS) Manager.
  2. Txoj nyem rau ntawm qhov chaw koj xav tau pab CORS rau thiab mus rau Properties.
  3. Hloov mus rau HTTP Headers tab.
  4. Hauv Custom HTTP taub hau ntu, nias Ntxiv .
  5. Nkag mus Nkag mus - Tswj - Tso cai - Keeb kwm raws li cov taub hau npe.
  6. Sau * raws li cov taub hau tus nqi.
  7. Nyem Ok ob zaug.

Ntxiv mus, kev tswj kev nkag mus li cas tso cai rau Keeb Kwm header ua haujlwm?

14 Teb. Nkag mus - Tswj - Tso cai - Keeb kwm yog CORS ( Hla - Keeb kwm Kev sib faib peev txheej) taub hau . Thaum Site A sim nqa cov ntsiab lus los ntawm Site B, Site B ua tau xa ib Nkag mus - Tswj - Tso cai - Keeb kwm teb taub hau qhia rau tus browser tias cov ntsiab lus ntawm nplooj ntawv no nkag mus rau qee lub hauv paus chiv keeb.

Kuj Paub, Dab tsi yog Keeb Kwm thov header? Cov Keeb kwm thov header qhia qhov twg ib tug nqa los ntawm. Nws tsis suav nrog cov ntaub ntawv kab lus, tab sis tsuas yog lub npe server. Nws raug xa nrog CORS thov , nrog rau POST thov . Nws zoo ib yam li tus neeg xa xov taub hau , tab sis, tsis zoo li qhov no taub hau , nws tsis qhia tag nrho txoj kev.

Tsis tas li ntawd, kuv yuav ua li cas thiaj li daws tau qhov kev tswj xyuas kev tso cai rau lub hauv paus?

Txoj hauv kev los kho qhov teeb meem no muaj xws li:

  1. Ntxiv kev txhawb nqa ntawm OPTIONS txoj kev kom CORS preflight thov siv tau.
  2. Ntxiv rau Access-Control-Allow-Origin header hauv koj cov lus teb kom lub browser tuaj yeem tshawb xyuas qhov kev thov siv tau.

Cors txoj cai tsis muaj kev tswj xyuas kev tso cai yog dab tsi?

Hauv luv luv, tsis muaj . Cov nkag mus - tswj - tso cai - keeb kwm plugin tseem ceeb tua qhov browser tib yam- keeb kwm txoj cai . Rau txhua qhov kev thov, nws yuav ntxiv cov Nkag mus - Tswj - Tso cai - Keeb kwm : * taub hau rau qhov teb. Nws tricks lub browser, thiab overrides lub COV header tias tus neeg rau zaub mov muaj nyob rau hauv qhov chaw nrog tus nqi qhib wildcard.

Pom zoo: